Class BlockLeaves

Direct Known Subclasses:
BloodWoodLeavesBlock

public class BlockLeaves extends BlockLeavesBase
  • Field Details

    • LEAF_TYPES

      public static final String[] LEAF_TYPES
    • adjacentTreeBlocks

      public int[] adjacentTreeBlocks
    • ADJACENT_TREE_BLOCK_ARRAY_WIDTH

      protected static final int ADJACENT_TREE_BLOCK_ARRAY_WIDTH
      See Also:
    • ARRAY_WIDTH_HALF

      protected static final int ARRAY_WIDTH_HALF
      See Also:
    • ADJACENT_TREE_BLOCK_SEARCH_DIST

      protected static final int ADJACENT_TREE_BLOCK_SEARCH_DIST
      See Also:
    • ADJACENT_TREE_BLOCK_CHUNK_CHECK_DIST

      protected static final int ADJACENT_TREE_BLOCK_CHUNK_CHECK_DIST
      See Also:
    • adjacentTreeBlocks3D

      protected int[][][] adjacentTreeBlocks3D
    • field_94396_b

      public static final String[][] field_94396_b
  • Constructor Details

    • BlockLeaves

      protected BlockLeaves(int par1)
  • Method Details

    • breakBlock

      public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
      Called on server worlds only when the block has been replaced by a different block ID, or the same block with a different metadata value, but before the new metadata value is set. Args: World, x, y, z, old block ID, old metadata
      Overrides:
      breakBlock in class Block
    • quantityDropped

      public int quantityDropped(Random par1Random)
      Returns the quantity of items to drop on block destruction.
      Overrides:
      quantityDropped in class Block
    • idDropped

      public int idDropped(int metadata, Random rand, int fortuneModifier)
      Returns the ID of the items to drop on destruction.
      Overrides:
      idDropped in class Block
    • harvestBlock

      public void harvestBlock(World par1World, EntityPlayer par2EntityPlayer, int par3, int par4, int par5, int par6)
      Called when the player destroys a block with an item that can harvest it. (i, j, k) are the coordinates of the block and l is the block's subtype/damage.
      Overrides:
      harvestBlock in class Block
    • damageDropped

      public int damageDropped(int par1)
      Determines the damage on the item the block drops. Used in cloth and wood.
      Overrides:
      damageDropped in class Block
    • setGraphicsLevel

      public void setGraphicsLevel(boolean par1)
      Pass true to draw this block using fancy graphics, or false for fast graphics.
    • getSubBlocks

      public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3List)
      returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
      Overrides:
      getSubBlocks in class Block
    • createStackedBlock

      protected ItemStack createStackedBlock(int par1)
      Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
      Overrides:
      createStackedBlock in class Block
    • getMovementModifier

      public float getMovementModifier(World world, int i, int j, int k)
      Overrides:
      getMovementModifier in class Block
    • canGroundCoverRestOnBlock

      public boolean canGroundCoverRestOnBlock(World world, int i, int j, int k)
      Overrides:
      canGroundCoverRestOnBlock in class Block
    • dropBlockAsItemWithChance

      public void dropBlockAsItemWithChance(World world, int i, int j, int k, int iMetadata, float fChance, int iFortuneModifier)
      Description copied from class: Block
      Drops the block items with a specified chance of dropping the specified items
      Overrides:
      dropBlockAsItemWithChance in class Block
    • updateTick

      public void updateTick(World world, int i, int j, int k, Random rand)
      Description copied from class: Block
      Ticks the block if it's been scheduled // +++START EDIT+++ FCNOTE: Called on server only // ---END EDIT---
      Overrides:
      updateTick in class Block
    • onDestroyedByFire

      public void onDestroyedByFire(World world, int i, int j, int k, int iFireAge, boolean bForcedFireSpread)
      Overrides:
      onDestroyedByFire in class Block
    • getStackRetrievedByBlockDispenser

      public ItemStack getStackRetrievedByBlockDispenser(World world, int i, int j, int k)
      Description copied from class: Block
      If the stack returned is null, the block will not be retrieved
      Overrides:
      getStackRetrievedByBlockDispenser in class Block
    • canMobsSpawnOn

      public boolean canMobsSpawnOn(World world, int i, int j, int k)
      Description copied from class: Block
      This is only a first-pass indicator as to whether ANY mobs can spawn on top of the block, so stuff like leaves where only Jungle Spiders can spawn on them, should still return true.
      Overrides:
      canMobsSpawnOn in class Block
    • isLeafBlock

      public boolean isLeafBlock(IBlockAccess blockAccess, int x, int y, int z)
      Overrides:
      isLeafBlock in class Block
    • generateAshOnBurn

      protected void generateAshOnBurn(World world, int i, int j, int k)
    • updateAdjacentTreeBlockArray

      protected void updateAdjacentTreeBlockArray(World world, int x, int y, int z)
    • registerIcons

      @Environment(CLIENT) public void registerIcons(IconRegister par1IconRegister)
      Description copied from class: Block
      When this method is called, your block should register all the icons it needs with the given IconRegister. This is the only chance you get to register icons.
      Overrides:
      registerIcons in class Block
    • getIcon

      @Environment(CLIENT) public Icon getIcon(int par1, int par2)
      Description copied from class: Block
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • randomDisplayTick

      @Environment(CLIENT) public void randomDisplayTick(World world, int i, int j, int k, Random rand)
      Description copied from class: Block
      A randomly called display update to be able to add particles or other items for display
      Overrides:
      randomDisplayTick in class Block
    • getBlockColor

      @Environment(CLIENT) public int getBlockColor()
      Overrides:
      getBlockColor in class Block
    • getRenderColor

      @Environment(CLIENT) public int getRenderColor(int par1)
      Description copied from class: Block
      Returns the color this block should be rendered. Used by leaves.
      Overrides:
      getRenderColor in class Block
    • colorMultiplier

      @Environment(CLIENT) public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
      Description copied from class: Block
      Returns a integer with hex for 0xrrggbb with this color multiplied against the blocks color. Note only called when first determining what to render.
      Overrides:
      colorMultiplier in class Block