Class ClusterBlockItem

Direct Known Subclasses:
CandleItem, StoneItem

public class ClusterBlockItem extends PlaceAsBlockItem
Item counterpart of ClusterBlock.

Attempts to combine with provided block ID on use

  • Constructor Details

    • ClusterBlockItem

      public ClusterBlockItem(int itemID, int blockID, String name)
    • ClusterBlockItem

      public ClusterBlockItem(int itemID, int blockID, int metadata, String name)
  • Method Details

    • getBlockIDToPlace

      public int getBlockIDToPlace(int itemDamage, int facing, float clickX, float clickY, float clickZ)
      Overrides:
      getBlockIDToPlace in class PlaceAsBlockItem
    • onItemUse

      public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int facing, float clickX, float clickY, float clickZ)
      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 PlaceAsBlockItem
    • attemptToCombine

      public boolean attemptToCombine(ItemStack stack, World world, int x, int y, int z, int facing, float clickX, float clickY, float clickZ)
      Returns true if combining item with ClusterBlock is successful
    • getBlockIDForItemDamage

      public int getBlockIDForItemDamage(int itemDamage)
      Returns block ID based on damage
    • canPlaceItemBlockOnSide

      @Environment(CLIENT) public boolean canPlaceItemBlockOnSide(World world, int x, int y, int z, int facing, EntityPlayer player, ItemStack itemStack)
      Overrides:
      canPlaceItemBlockOnSide in class PlaceAsBlockItem