Class SaplingBlock


public class SaplingBlock extends DailyGrowthCropsBlock
  • Constructor Details

    • SaplingBlock

      public SaplingBlock(int id, String name, String textureBase)
  • Method Details

    • updateTick

      public void updateTick(World world, int x, int y, int z, 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 CropsBlock
    • attemptToGrow

      protected void attemptToGrow(World world, int x, int y, int z, Random rand)
      Overrides:
      attemptToGrow in class DailyGrowthCropsBlock
    • incrementGrowthLevel

      protected void incrementGrowthLevel(World world, int x, int y, int z)
      Overrides:
      incrementGrowthLevel in class CropsBlock
    • onCreativeBonemealApplied

      public boolean onCreativeBonemealApplied(World world, int x, int y, int z)
      Called when bonemeal is applied in creative mode.
      Overrides:
      onCreativeBonemealApplied in class DailyGrowthCropsBlock
    • requiresNaturalLight

      protected boolean requiresNaturalLight()
      Overrides:
      requiresNaturalLight in class CropsBlock
    • canWeedsGrowInBlock

      public boolean canWeedsGrowInBlock(IBlockAccess blockAccess, int i, int j, int k)
      Description copied from class: Block
      This determines whether weeds can share space with crop blocks, or grow within their own independent weed blocks
      Overrides:
      canWeedsGrowInBlock in class CropsBlock
    • canGrowOnBlock

      protected boolean canGrowOnBlock(World world, int x, int y, int z)
      Overrides:
      canGrowOnBlock in class CropsBlock
    • canBeCrushedByFallingEntity

      public boolean canBeCrushedByFallingEntity(World world, int i, int j, int k, EntityFallingSand entity)
      Overrides:
      canBeCrushedByFallingEntity in class Block
    • getBlockBoundsFromPoolBasedOnState

      public AxisAlignedBB getBlockBoundsFromPoolBasedOnState(IBlockAccess blockAccess, int x, int y, int z)
      Overrides:
      getBlockBoundsFromPoolBasedOnState in class CropsBlock
    • idDropped

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

      public int damageDropped(int metadata)
      Description copied from class: Block
      Determines the damage on the item the block drops. Used in cloth and wood.
      Overrides:
      damageDropped in class Block
    • getCropItemID

      protected int getCropItemID()
      Specified by:
      getCropItemID in class CropsBlock
    • getSeedItemID

      protected int getSeedItemID()
      Specified by:
      getSeedItemID in class CropsBlock
    • onlyDropWhenFullyGrown

      protected boolean onlyDropWhenFullyGrown()
      Overrides:
      onlyDropWhenFullyGrown in class CropsBlock
    • attemptToGrowTree

      protected void attemptToGrowTree(World world, int x, int y, int z)
    • checkFor2x2Tree

      protected boolean checkFor2x2Tree(World world, int x, int y, int z)
    • attemptToGrow2x2Tree

      protected void attemptToGrow2x2Tree(World world, int x, int y, int z)
    • canGrow2x2Tree

      protected int canGrow2x2Tree(World world, int x, int y, int z)
      This method can be called from positions next to the sapling, so it needs to verify its own location as well
    • getTreeGrower

      public AbstractTreeGrower getTreeGrower(Random rand)
    • getTreeGrower2x2

      public AbstractTreeGrower getTreeGrower2x2(Random rand)
    • addTreeGrower

      public SaplingBlock addTreeGrower(AbstractTreeGrower grower, int weight)
    • add2x2TreeGrower

      public SaplingBlock add2x2TreeGrower(AbstractTreeGrower grower, int weight)
    • removeTreeGrower

      public boolean removeTreeGrower(String name)
    • registerIcons

      @Environment(CLIENT) public void registerIcons(IconRegister register)
      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 side, int metadata)
      Description copied from class: Block
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • getSubBlocks

      @Environment(CLIENT) public void getSubBlocks(int metadata, CreativeTabs creativeTabs, List list)
      Description copied from class: Block
      returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
      Overrides:
      getSubBlocks in class Block
    • renderBlock

      @Environment(CLIENT) public boolean renderBlock(RenderBlocks renderer, int x, int y, int z)
      Overrides:
      renderBlock in class CropsBlock
    • getRenderType

      @Environment(CLIENT) public int getRenderType()
      Description copied from class: Block
      The type of render function that is called for this block
      Overrides:
      getRenderType in class Block