Class BlockCrops

Direct Known Subclasses:
BlockCarrot, BlockPotato, HempCropBlock, LegacyWheatBlock

public class BlockCrops extends BlockFlower
  • Constructor Details

    • BlockCrops

      protected BlockCrops(int par1)
  • Method Details

    • fertilize

      public void fertilize(World par1World, int par2, int par3, int par4)
      // +++START EDIT+++ // ---END EDIT--- Apply bonemeal to the crops.
    • onCreativeBonemealApplied

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

      public Icon getIcon(int par1, int par2)
      // +++START EDIT+++ // ---END EDIT--- From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon in class Block
    • getRenderType

      public int getRenderType()
      The type of render function that is called for this block
      Overrides:
      getRenderType in class BlockFlower
    • getSeedItem

      protected int getSeedItem()
      Generate a seed ItemStack for this crop.
    • getCropItem

      protected int getCropItem()
      Generate a crop produce ItemStack for this crop.
    • dropBlockAsItemWithChance

      public void dropBlockAsItemWithChance(World par1World, int par2, int par3, int par4, int par5, float par6, int par7)
      Drops the block items with a specified chance of dropping the specified items
      Overrides:
      dropBlockAsItemWithChance in class Block
    • quantityDropped

      public int quantityDropped(Random par1Random)
      // +++START EDIT+++ // ---END EDIT--- Returns the quantity of items to drop on block destruction.
      Overrides:
      quantityDropped in class Block
    • idPicked

      public int idPicked(World par1World, int par2, int par3, int par4)
      only called by clickMiddleMouseButton , and passed to inventory.setCurrentItem (along with isCreative)
      Overrides:
      idPicked in class Block
    • registerIcons

      public void registerIcons(IconRegister par1IconRegister)
      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
    • idDropped

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

      public boolean canBeGrazedOn(IBlockAccess blockAccess, int i, int j, int k, EntityAnimal animal)
      Overrides:
      canBeGrazedOn in class BlockFlower
    • 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: BlockFlower
      Ticks the block if it's been scheduled
      Overrides:
      updateTick in class BlockFlower
    • canGrowOnBlock

      protected boolean canGrowOnBlock(World world, int i, int j, int k)
      Overrides:
      canGrowOnBlock in class PlantsBlock
    • 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
    • attemptToGrow

      protected void attemptToGrow(World world, int i, int j, int k, Random rand)
    • dropSeeds

      public void dropSeeds(World world, int i, int j, int k, int iMetadata, float fChance, int iFortuneModifier)
    • 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

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

      protected 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)
    • renderBlock

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