Class BlockDispenser

All Implemented Interfaces:
ITileEntityProvider
Direct Known Subclasses:
BlockDropper

public class BlockDispenser extends BlockContainer
  • Field Details

    • dispenseBehaviorRegistry

      public static final IRegistry dispenseBehaviorRegistry
      Registry for all dispense behaviors.
    • random

      protected Random random
    • furnaceTopIcon

      protected Icon furnaceTopIcon
    • furnaceFrontIcon

      protected Icon furnaceFrontIcon
    • field_96473_e

      protected Icon field_96473_e
  • Constructor Details

    • BlockDispenser

      protected BlockDispenser(int par1)
  • Method Details

    • getFacing

      public int getFacing(int iMetadata)
      Overrides:
      getFacing in class Block
    • setFacing

      public int setFacing(int iMetadata, int iFacing)
      Overrides:
      setFacing in class Block
    • onBlockPlacedBy

      public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityLiving, ItemStack stack)
      Description copied from class: Block
      Called when the block is placed in the world. // +++START EDIT+++ FCNOTE: Called AFTER the block is placed, unlike onBlockPlaced() // ---END EDIT---
      Overrides:
      onBlockPlacedBy in class Block
    • tickRate

      public int tickRate(World par1World)
      How many world ticks before ticking
      Overrides:
      tickRate 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
    • getIcon

      public Icon getIcon(int par1, int par2)
      From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
      Overrides:
      getIcon 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
    • 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
    • dispense

      protected void dispense(World par1World, int par2, int par3, int par4)
    • getBehaviorForItemStack

      protected IBehaviorDispenseItem getBehaviorForItemStack(ItemStack par1ItemStack)
      Returns the behavior for the given ItemStack.
    • 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
    • updateTick

      public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random)
      Ticks the block if it's been scheduled
      Overrides:
      updateTick in class Block
    • createNewTileEntity

      public TileEntity createNewTileEntity(World par1World)
      Returns a new instance of a block's tile entity class. Called on placing the 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
    • getIPositionFromBlockSource

      public static IPosition getIPositionFromBlockSource(IBlockSource par0IBlockSource)
    • getDispenserFacing

      public static EnumFacing getDispenserFacing(int par0)
    • 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