Class CropsBlock

Direct Known Subclasses:
DailyGrowthCropsBlock

public abstract class CropsBlock extends PlantsBlock
  • Field Details

  • Constructor Details

    • CropsBlock

      protected CropsBlock(int iBlockID)
  • Method Details

    • onNeighborBlockChange

      public void onNeighborBlockChange(World world, int i, int j, int k, int iNeighborBlockID)
      Description copied from class: Block
      Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are their own) Args: x, y, z, neighbor blockID // +++START EDIT+++ FCNOTE: Only called on server // ---END EDIT---
      Overrides:
      onNeighborBlockChange in class Block
    • dropBlockAsItemWithChance

      public void dropBlockAsItemWithChance(World world, int x, int y, int z, int metadata, float chance, int fortuneModifier)
      Description copied from class: Block
      Drops the block items with a specified chance of dropping the specified items
      Overrides:
      dropBlockAsItemWithChance in class Block
    • onlyDropWhenFullyGrown

      protected boolean onlyDropWhenFullyGrown()
    • idDropped

      public int idDropped(int iMetadata, Random rand, int iFortuneModifier)
      Description copied from class: Block
      Returns the ID of the items to drop on destruction.
      Overrides:
      idDropped in class Block
    • getBlockBoundsFromPoolBasedOnState

      public AxisAlignedBB getBlockBoundsFromPoolBasedOnState(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      getBlockBoundsFromPoolBasedOnState in class Block
    • canBeGrazedOn

      public boolean canBeGrazedOn(IBlockAccess blockAccess, int i, int j, int k, EntityAnimal animal)
      Overrides:
      canBeGrazedOn in class Block
    • onGrazed

      public void onGrazed(World world, int i, int j, int k, EntityAnimal animal)
      Overrides:
      onGrazed 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
    • 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 Block
    • getConvertsLegacySoil

      public boolean getConvertsLegacySoil(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      getConvertsLegacySoil in class Block
    • canGrowOnBlock

      protected boolean canGrowOnBlock(World world, int i, int j, int k)
      Overrides:
      canGrowOnBlock in class PlantsBlock
    • getCropItemID

      protected abstract int getCropItemID()
    • getSeedItemID

      protected abstract int getSeedItemID()
    • updateIfBlockStays

      protected boolean updateIfBlockStays(World world, int i, int j, int k)
    • attemptToGrow

      protected void attemptToGrow(World world, int x, int y, int z, Random rand)
    • dropSeeds

      public void dropSeeds(World world, int i, int j, int k, int iMetadata)
    • getBaseGrowthChance

      public float getBaseGrowthChance(World world, int i, int j, int k)
    • incrementGrowthLevel

      protected void incrementGrowthLevel(World world, int i, int j, int k)
    • getGrowthLevel

      public int getGrowthLevel(IBlockAccess blockAccess, int i, int j, int k)
    • getGrowthLevel

      public int getGrowthLevel(int iMetadata)
    • setGrowthLevel

      protected void setGrowthLevel(World world, int i, int j, int k, int iLevel)
    • setGrowthLevelNoNotify

      protected void setGrowthLevelNoNotify(World world, int i, int j, int k, int iLevel)
    • isFullyGrown

      protected boolean isFullyGrown(World world, int i, int j, int k)
    • isFullyGrown

      protected boolean isFullyGrown(int iMetadata)
    • getLightLevelForGrowth

      protected int getLightLevelForGrowth()
    • canGrowAtCurrentLightLevel

      protected boolean canGrowAtCurrentLightLevel(World world, int x, int y, int z)
    • requiresNaturalLight

      protected boolean requiresNaturalLight()
    • renderBlock

      @Environment(CLIENT) public boolean renderBlock(RenderBlocks renderer, int i, int j, int k)
      Overrides:
      renderBlock in class PlantsBlock
    • renderCrops

      @Environment(CLIENT) protected void renderCrops(RenderBlocks renderer, int i, int j, int k)
    • idPicked

      @Environment(CLIENT) public int idPicked(World world, int i, int j, int k)
      Description copied from class: Block
      only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative) // +++START EDIT+++ FCNOTE: Client only // ---END EDIT---
      Overrides:
      idPicked in class Block