Class BlockChest

All Implemented Interfaces:
ITileEntityProvider

public class BlockChest extends BlockContainer
  • Field Details

    • chestType

      public final int chestType
      1 for trapped chests, 0 for normal chests.
  • Constructor Details

    • BlockChest

      public BlockChest(int par1, int par2)
  • Method Details

    • isOpaqueCube

      public boolean isOpaqueCube()
      Is this block (a) opaque and (b) a full 1m cube? This determines whether or not to render the shared face of two adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
      Overrides:
      isOpaqueCube in class Block
    • isIncineratedInCrucible

      public boolean isIncineratedInCrucible()
      Overrides:
      isIncineratedInCrucible in class Block
    • renderAsNormalBlock

      public boolean renderAsNormalBlock()
      If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
      Overrides:
      renderAsNormalBlock in class Block
    • getRenderType

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

      public void onBlockAdded(World par1World, int par2, int par3, int par4)
      Called whenever the block is added into the world. Args: world, x, y, z
      Overrides:
      onBlockAdded in class BlockContainer
    • onBlockPlacedBy

      public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
      Called when the block is placed in the world.
      Overrides:
      onBlockPlacedBy in class Block
    • unifyAdjacentChests

      public void unifyAdjacentChests(World par1World, int par2, int par3, int par4)
      Turns the adjacent chests to a double chest.
    • canPlaceBlockAt

      public boolean canPlaceBlockAt(World par1World, int par2, int par3, int par4)
      Checks to see if its valid to put this block at the specified coordinates. Args: world, x, y, z
      Overrides:
      canPlaceBlockAt in class Block
    • onNeighborBlockChange

      public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
      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
      Overrides:
      onNeighborBlockChange in class Block
    • 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 BlockContainer
    • onBlockActivated

      public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
      Called upon block activation (right click on the block.)
      Overrides:
      onBlockActivated in class Block
    • getInventory

      public IInventory getInventory(World par1World, int par2, int par3, int par4)
      Gets the inventory of the chest at the specified coords, accounting for blocks or ocelots on top of the chest, and double chests.
    • createNewTileEntity

      public TileEntity createNewTileEntity(World world)
      Description copied from interface: ITileEntityProvider
      Returns a new instance of a block's tile entity class. Called on placing the block.
    • getBlockBoundsFromPoolBasedOnState

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

      protected boolean canSilkHarvest(int iMetadata)
      Overrides:
      canSilkHarvest in class Block
    • getHarvestToolLevel

      public int getHarvestToolLevel(IBlockAccess blockAccess, int i, int j, int k)
      Overrides:
      getHarvestToolLevel in class Block
    • dropComponentItemsOnBadBreak

      public boolean dropComponentItemsOnBadBreak(World world, int i, int j, int k, int iMetadata, float fChanceOfDrop)
      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
    • canRotateOnTurntable

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

      public int rotateMetadataAroundYAxis(int iMetadata, boolean bReverse)
      Overrides:
      rotateMetadataAroundYAxis in class Block
    • canSupportFallingBlocks

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

      public boolean canProvidePower()
      Can this block provide power. Only wire currently seems to have this change based on its state.
      Overrides:
      canProvidePower in class Block
    • isProvidingWeakPower

      public int isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
      Returns true if the block is emitting indirect/weak redstone power on the specified side. If isBlockNormalCube returns true, standard redstone propagation rules will apply instead and this will not be called. Args: World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
      Overrides:
      isProvidingWeakPower in class Block
    • isProvidingStrongPower

      public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
      Returns true if the block is emitting direct/strong redstone power on the specified side. Args: World, X, Y, Z, side. Note that the side is reversed - eg it is 1 (up) when checking the bottom of the block.
      Overrides:
      isProvidingStrongPower in class Block
    • hasComparatorInputOverride

      public boolean hasComparatorInputOverride()
      If this returns true, then comparators facing away from this block will use the value from getComparatorInputOverride instead of the actual redstone signal strength.
      Overrides:
      hasComparatorInputOverride in class Block
    • getComparatorInputOverride

      public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
      If hasComparatorInputOverride returns true, the return value from this is used instead of the redstone signal strength when this block inputs to a comparator.
      Overrides:
      getComparatorInputOverride in class Block
    • renderBlock

      @Environment(CLIENT) public boolean renderBlock(RenderBlocks renderBlocks, int i, int j, int k)
      Overrides:
      renderBlock 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