Class PlaceAsBlockItem

java.lang.Object
net.minecraft.src.Item
api.item.items.PlaceAsBlockItem
Direct Known Subclasses:
BedItem, BrickItem, BucketItem, ClusterBlockItem, CrudeUnfiredBrickItem, ItemBlock, ItemReed, LegacyCandleItem, LegacyGrateItem, LegacySlatsItem, LegacyWickerPaneItem, OreChunkItemGold, OreChunkItemIron, RedstoneItem, RedstoneRepeaterItem, UnfiredNetherBrickItem

public class PlaceAsBlockItem extends Item
  • Field Details

    • blockID

      protected int blockID
    • blockMetadata

      protected int blockMetadata
    • requireNoEntitiesInTargetBlock

      protected boolean requireNoEntitiesInTargetBlock
  • Constructor Details

    • PlaceAsBlockItem

      public PlaceAsBlockItem(int iItemID, int iBlockID)
    • PlaceAsBlockItem

      public PlaceAsBlockItem(int iItemID, int iBlockID, int iBlockMetadata)
    • PlaceAsBlockItem

      public PlaceAsBlockItem(int iItemID, int iBlockID, int iBlockMetadata, String sItemName)
    • PlaceAsBlockItem

      protected PlaceAsBlockItem(int iItemID)
      This constructor should only be called by ItemBlock child class
  • Method Details

    • onItemUse

      public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int i, int j, int k, int iFacing, float fClickX, float fClickY, float fClickZ)
      Description copied from class: Item
      Callback for item usage. If the item does something special on right clicking, he will have one of those. Return True if something happen and false if it don't. This is for ITEMS, not BLOCKS
      Overrides:
      onItemUse in class Item
    • getMetadata

      public int getMetadata(int iItemDamage)
      Description copied from class: Item
      Returns the metadata of the block which this Item (ItemBlock) can place
      Overrides:
      getMetadata in class Item
    • canItemBeUsedByPlayer

      public boolean canItemBeUsedByPlayer(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack)
      Description copied from class: Item
      Method which replaces canPlaceItemBlockOnSide() in ItemBlock. Allows the client to prevent item usage before it is relayed to the server by returning false. Only called on client.
      Overrides:
      canItemBeUsedByPlayer in class Item
    • onItemUsedByBlockDispenser

      public boolean onItemUsedByBlockDispenser(ItemStack stack, World world, int i, int j, int k, int iFacing)
      Description copied from class: Item
      This method should return true if the item is successfully placed (in which case the BD will consume the corresponding item in its inventory), false otherwise. Co-ordinates specify the BD position.
      Overrides:
      onItemUsedByBlockDispenser in class Item
    • getBlockID

      public int getBlockID()
    • canPlaceItemBlockOnSide

      public boolean canPlaceItemBlockOnSide(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack)
    • setAssociatedBlockID

      public PlaceAsBlockItem setAssociatedBlockID(int iBlockID)
    • getBlockIDToPlace

      public int getBlockIDToPlace(World world, int itemDamage, int facing, float clickX, float clickY, float clickZ)
    • getBlockIDToPlace

      public int getBlockIDToPlace(int iItemDamage, int iFacing, float fClickX, float fClickY, float fClickZ)
    • isTargetFreeOfObstructingEntities

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

      protected void playPlaceSound(World world, int i, int j, int k, Block block)
    • getTargetFacingPlacedByBlockDispenser

      public int getTargetFacingPlacedByBlockDispenser(int iDispenserFacing)