Class BlockGrass

java.lang.Object
net.minecraft.src.Block
net.minecraft.src.BlockGrass

public class BlockGrass extends Block
  • Field Details

    • SPREAD_LIGHT_LEVEL

      public static final int SPREAD_LIGHT_LEVEL
      See Also:
    • SURVIVE_LIGHT_LEVEL

      public static final int SURVIVE_LIGHT_LEVEL
      See Also:
    • SPREAD_CHANCE

      public static final float SPREAD_CHANCE
      See Also:
    • SELF_GROWTH_CHANCE

      public static final int SELF_GROWTH_CHANCE
      See Also:
    • HEMP_SEED_CHANCE

      public static final int HEMP_SEED_CHANCE
      See Also:
    • secondPass

      @Environment(CLIENT) public static boolean secondPass
  • Constructor Details

    • BlockGrass

      protected BlockGrass(int blockID)
  • 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 Block
    • canEndermenPickUpBlock

      public boolean canEndermenPickUpBlock(World world, int x, int y, int z)
      Overrides:
      canEndermenPickUpBlock in class Block
    • createStackedBlock

      protected ItemStack createStackedBlock(int metadata)
      Description copied from class: Block
      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. // +++START EDIT+++ FCNOTE: This is the function used to create the silk-touch drop // ---END EDIT---
      Overrides:
      createStackedBlock in class Block
    • 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 Block
    • dropComponentItemsOnBadBreak

      public boolean dropComponentItemsOnBadBreak(World world, int x, int y, int z, int metadata, float chanceOfDrop)
      Description copied from class: Block
      Called by explosions and improper tool use. Should return true if the block processes its own drops through this method, false otherwise Note that the block may no longer be at the specified position when this is called
      Overrides:
      dropComponentItemsOnBadBreak in class Block
    • onBlockDestroyedWithImproperTool

      public void onBlockDestroyedWithImproperTool(World world, EntityPlayer player, int x, int y, int z, int metadata)
      Description copied from class: Block
      Called on server only, after the block is removed from the world
      Overrides:
      onBlockDestroyedWithImproperTool in class Block
    • onBlockDestroyedByExplosion

      public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion)
      Description copied from class: Block
      // +++START EDIT+++ Called upon the block being destroyed by an explosion // ---END EDIT---
      Overrides:
      onBlockDestroyedByExplosion in class Block
    • onNeighborDirtDugWithImproperTool

      protected void onNeighborDirtDugWithImproperTool(World world, int x, int y, int z, int toFacing)
      Overrides:
      onNeighborDirtDugWithImproperTool in class Block
    • canBePistonShoveled

      public boolean canBePistonShoveled(World world, int x, int y, int z)
      Overrides:
      canBePistonShoveled in class Block
    • canBeGrazedOn

      public boolean canBeGrazedOn(IBlockAccess blockAccess, int x, int y, int z, EntityAnimal animal)
      Overrides:
      canBeGrazedOn in class Block
    • onGrazed

      public void onGrazed(World world, int x, int y, int z, EntityAnimal animal)
      Overrides:
      onGrazed in class Block
    • onVegetationAboveGrazed

      public void onVegetationAboveGrazed(World world, int x, int y, int z, EntityAnimal animal)
      Overrides:
      onVegetationAboveGrazed in class Block
    • canReedsGrowOnBlock

      public boolean canReedsGrowOnBlock(World world, int x, int y, int z)
      Overrides:
      canReedsGrowOnBlock in class Block
    • canSaplingsGrowOnBlock

      public boolean canSaplingsGrowOnBlock(World world, int x, int y, int z)
      Overrides:
      canSaplingsGrowOnBlock in class Block
    • canWildVegetationGrowOnBlock

      public boolean canWildVegetationGrowOnBlock(World world, int x, int y, int z)
      Description copied from class: Block
      Covers stuff like flowers and tall grass
      Overrides:
      canWildVegetationGrowOnBlock in class Block
    • getCanBlightSpreadToBlock

      public boolean getCanBlightSpreadToBlock(World world, int x, int y, int z, int blightLevel)
      Overrides:
      getCanBlightSpreadToBlock in class Block
    • canConvertBlock

      public boolean canConvertBlock(ItemStack stack, World world, int x, int y, int z)
      Overrides:
      canConvertBlock in class Block
    • convertBlock

      public boolean convertBlock(ItemStack stack, World world, int x, int y, int z, int fromSide)
      Description copied from class: Block
      Returns false if the block has not been replaced with another, and should be removed
      Overrides:
      convertBlock in class Block
    • shouldPlayStandardConvertSound

      public boolean shouldPlayStandardConvertSound(World world, int x, int y, int z)
      Overrides:
      shouldPlayStandardConvertSound in class Block
    • getCanGrassSpreadToBlock

      public boolean getCanGrassSpreadToBlock(World world, int x, int y, int z)
      Overrides:
      getCanGrassSpreadToBlock in class Block
    • spreadGrassToBlock

      public boolean spreadGrassToBlock(World world, int x, int y, int z)
      Overrides:
      spreadGrassToBlock in class Block
    • isBreakableBarricade

      public boolean isBreakableBarricade(World world, int i, int j, int k, boolean advancedBreaker)
      Overrides:
      isBreakableBarricade in class Block
    • canGrassSurviveAtLocation

      public static boolean canGrassSurviveAtLocation(World world, int x, int y, int z)
    • canGrassSpreadFromLocation

      public static boolean canGrassSpreadFromLocation(World world, int x, int y, int z)
    • checkForGrassSpreadFromLocation

      public static void checkForGrassSpreadFromLocation(World world, int x, int y, int z)
    • attempToSpreadGrassToLocation

      public static boolean attempToSpreadGrassToLocation(World world, int x, int y, int z)
    • isSparse

      public boolean isSparse(IBlockAccess blockAccess, int x, int y, int z)
    • isSparse

      public boolean isSparse(int metadata)
    • setSparse

      public void setSparse(World world, int x, int y, int z)
    • setFullyGrown

      public void setFullyGrown(World world, int x, int y, int z)
    • 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
    • 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
    • colorMultiplier

      @Environment(CLIENT) public int colorMultiplier(IBlockAccess blockAccess, int x, int y, int z)
      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
    • shouldSideBeRendered

      @Environment(CLIENT) public boolean shouldSideBeRendered(IBlockAccess blockAccess, int neighborX, int neighborY, int neighborZ, int side)
      Overrides:
      shouldSideBeRendered in class Block
    • getBlockTexture

      @Environment(CLIENT) public Icon getBlockTexture(IBlockAccess blockAccess, int x, int y, int z, int side)
      Description copied from class: Block
      Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
      Overrides:
      getBlockTexture in class Block
    • getBlockTextureSecondPass

      @Environment(CLIENT) public Icon getBlockTextureSecondPass(IBlockAccess blockAccess, int x, int y, int z, int side)
    • renderBlock

      @Environment(CLIENT) public boolean renderBlock(RenderBlocks render, int x, int y, int z)
      Overrides:
      renderBlock in class Block
    • renderBlockSecondPass

      @Environment(CLIENT) public void renderBlockSecondPass(RenderBlocks render, int x, int y, int z, boolean firstPassResult)
      Description copied from class: Block
      If the block has a second pass, like a kiln cooking overlay texture, it should Override this method. This method does not call the overlay by default to cut down on rendering time, since this function is called by every single loaded block. Note that this function is necessary to prevent potential recursion within RenderBlock, if it were to call its own overlays directly, and then potentially get called with a texture overlay itself through RenderBlockWithTexture.
      Overrides:
      renderBlockSecondPass 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
    • 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