Class ToolItem

java.lang.Object
net.minecraft.src.Item
api.item.items.ToolItem
All Implemented Interfaces:
PlaceableAsItem
Direct Known Subclasses:
AxeItem, ChiselItem, HoeItem, PickaxeItem, ShovelItem

public abstract class ToolItem extends Item implements PlaceableAsItem
Class to fully replace ItemTool due to large amount of refactoring that was applied to that class
  • Field Details

    • efficiencyOnProperMaterial

      protected float efficiencyOnProperMaterial
    • damageVsEntity

      protected float damageVsEntity
    • toolMaterial

      public EnumToolMaterial toolMaterial
  • Constructor Details

    • ToolItem

      protected ToolItem(int iITemID, int iBaseEntityDamage, EnumToolMaterial par3EnumToolMaterial)
  • Method Details

    • hitEntity

      public boolean hitEntity(ItemStack stack, EntityLivingBase defendingEntity, EntityLivingBase attackingEntity)
      Description copied from class: Item
      Current implementations of this method in child classes do not use the entry argument beside ev. They just raise the damage on the stack.
      Overrides:
      hitEntity in class Item
    • onBlockDestroyed

      public boolean onBlockDestroyed(ItemStack stack, World world, int iBlockID, int i, int j, int k, EntityLivingBase usingEntity)
      Overrides:
      onBlockDestroyed in class Item
    • getItemAttributeModifiers

      public com.google.common.collect.Multimap getItemAttributeModifiers()
      Description copied from class: Item
      Gets a map of item attribute modifiers, used by ItemSword to increase hit damage.
      Overrides:
      getItemAttributeModifiers in class Item
    • getItemEnchantability

      public int getItemEnchantability()
      Description copied from class: Item
      Return the enchantability factor of the item, most of the time is based on material.
      Overrides:
      getItemEnchantability in class Item
    • isEnchantmentApplicable

      public boolean isEnchantmentApplicable(Enchantment enchantment)
      Overrides:
      isEnchantmentApplicable in class Item
    • getStrVsBlock

      public float getStrVsBlock(ItemStack stack, World world, Block block, int i, int j, int k)
      Overrides:
      getStrVsBlock in class Item
    • isEfficientVsBlock

      public boolean isEfficientVsBlock(ItemStack stack, World world, Block block, int i, int j, int k)
      Overrides:
      isEfficientVsBlock in class Item
    • onCreated

      public void onCreated(ItemStack stack, World world, EntityPlayer player)
      Description copied from class: Item
      Called when item is crafted/smelted. Used only by maps so far.
      Overrides:
      onCreated 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
    • onItemUse

      public boolean onItemUse(ItemStack stack, 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
    • isToolTypeEfficientVsBlockType

      public abstract boolean isToolTypeEfficientVsBlockType(Block block)
    • setDamageVsEntity

      public ToolItem setDamageVsEntity(int iDamage)
    • applyStandardEfficiencyModifiers

      public void applyStandardEfficiencyModifiers()
    • addCustomEfficiencyMultiplier

      public void addCustomEfficiencyMultiplier(float multiplier)
    • canToolStickInBlock

      public boolean canToolStickInBlock(ItemStack stack, Block block, World world, int i, int j, int k)
    • playPlacementSound

      public void playPlacementSound(ItemStack stack, Block blockStuckIn, World world, int i, int j, int k)
    • getCanBePlacedAsBlock

      public boolean getCanBePlacedAsBlock()
    • getVisualVerticalOffsetAsBlock

      public float getVisualVerticalOffsetAsBlock()
      Specified by:
      getVisualVerticalOffsetAsBlock in interface PlaceableAsItem
    • getVisualHorizontalOffsetAsBlock

      public float getVisualHorizontalOffsetAsBlock()
      Specified by:
      getVisualHorizontalOffsetAsBlock in interface PlaceableAsItem
    • getVisualRollOffsetAsBlock

      public float getVisualRollOffsetAsBlock()
      Specified by:
      getVisualRollOffsetAsBlock in interface PlaceableAsItem
    • getBlockBoundingBoxHeight

      public float getBlockBoundingBoxHeight()
      Specified by:
      getBlockBoundingBoxHeight in interface PlaceableAsItem
    • getBlockBoundingBoxWidth

      public float getBlockBoundingBoxWidth()
      Specified by:
      getBlockBoundingBoxWidth in interface PlaceableAsItem
    • isFull3D

      @Environment(CLIENT) public boolean isFull3D()
      Description copied from class: Item
      Returns True is the item is renderer in full 3D when hold.
      Overrides:
      isFull3D in class Item