Package api.item.items
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
Class to fully replace ItemTool due to large amount of refactoring that was applied to that class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected floatFields inherited from class net.minecraft.src.Item
appleGold, appleRed, arrow, axeDiamond, axeGold, axeIron, axeStone, axeWood, bakedPotato, BASE_CHICKEN_ITEM_FOOD_VALUE, BASE_HERBIVORE_ITEM_FOOD_VALUE, BASE_PIG_ITEM_FOOD_VALUE, bed, beefCooked, beefRaw, bFull3D, blazePowder, blazeRod, boat, bone, book, bootsChain, bootsDiamond, bootsGold, bootsIron, bootsLeather, bow, bowlEmpty, bowlSoup, bread, brewingStand, brick, bucketEmpty, bucketLava, bucketMilk, bucketWater, cake, carrot, carrotOnAStick, cauldron, chickenCooked, chickenRaw, clay, coal, comparator, compass, cookie, defaultFurnaceBurnTime, diamond, doorIron, doorWood, dyePowder, egg, emerald, emptyMap, enchantedBook, enderPearl, expBottle, eyeOfEnder, feather, fermentedSpiderEye, field_111210_e, FILTERABLE_FINE, FILTERABLE_NARROW, FILTERABLE_NO_PROPERTIES, FILTERABLE_SMALL, FILTERABLE_SOLID_BLOCK, FILTERABLE_THIN, fireballCharge, firework, fireworkCharge, fishCooked, fishingRod, fishRaw, flint, flintAndSteel, flowerPot, ghastTear, glassBottle, glowstone, goldenCarrot, goldNugget, gunpowder, hasSubtypes, helmetChain, helmetDiamond, helmetGold, helmetIron, helmetLeather, hoeDiamond, hoeGold, hoeIron, hoeStone, hoeWood, horseArmorDiamond, horseArmorGold, horseArmorIron, iconString, ingotGold, ingotIron, isInceratedInCrucible, itemFrame, itemIcon, itemID, itemRand, itemsList, leash, leather, legsChain, legsDiamond, legsGold, legsIron, legsLeather, magmaCream, map, maxStackSize, melon, melonSeeds, minecartCrate, minecartEmpty, minecartHopper, minecartPowered, minecartTnt, modID, modIDSetter, monsterPlacer, nameTag, netherQuartz, netherrackBrick, netherStalkSeeds, netherStar, painting, paper, pickaxeDiamond, pickaxeGold, pickaxeIron, pickaxeStone, pickaxeWood, plateChain, plateDiamond, plateGold, plateIron, plateLeather, pocketSundial, poisonousPotato, porkCooked, porkRaw, potato, potion, pumpkinPie, pumpkinSeeds, record11, record13, recordBlocks, recordCat, recordChirp, recordFar, recordMall, recordMellohi, recordStal, recordStrad, recordWait, recordWard, redstone, redstoneRepeater, reed, rottenFlesh, saddle, seeds, shears, shovelDiamond, shovelGold, shovelIron, shovelStone, shovelWood, sign, silk, skull, slimeBall, snowball, speckledMelon, spiderEye, stick, sugar, suppressConflictWarnings, swordDiamond, swordGold, swordIron, swordStone, swordWood, wheat, writableBook, writtenBook -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedToolItem(int iITemID, int iBaseEntityDamage, EnumToolMaterial par3EnumToolMaterial) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCustomEfficiencyMultiplier(float multiplier) voidbooleancanItemBeUsedByPlayer(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack) Method which replaces canPlaceItemBlockOnSide() in ItemBlock.booleancanToolStickInBlock(ItemStack stack, Block block, World world, int i, int j, int k) floatfloatbooleancom.google.common.collect.MultimapGets a map of item attribute modifiers, used by ItemSword to increase hit damage.intReturn the enchantability factor of the item, most of the time is based on material.floatgetStrVsBlock(ItemStack stack, World world, Block block, int i, int j, int k) floatfloatfloatbooleanhitEntity(ItemStack stack, EntityLivingBase defendingEntity, EntityLivingBase attackingEntity) Current implementations of this method in child classes do not use the entry argument beside ev.booleanisEfficientVsBlock(ItemStack stack, World world, Block block, int i, int j, int k) booleanisEnchantmentApplicable(Enchantment enchantment) booleanisFull3D()Returns True is the item is renderer in full 3D when hold.abstract booleanbooleanonBlockDestroyed(ItemStack stack, World world, int iBlockID, int i, int j, int k, EntityLivingBase usingEntity) voidonCreated(ItemStack stack, World world, EntityPlayer player) Called when item is crafted/smelted.booleanonItemUse(ItemStack stack, EntityPlayer player, World world, int i, int j, int k, int iFacing, float fClickX, float fClickY, float fClickZ) Callback for item usage.voidplayPlacementSound(ItemStack stack, Block blockStuckIn, World world, int i, int j, int k) setDamageVsEntity(int iDamage) Methods inherited from class net.minecraft.src.Item
addInformation, canHarvestBlock, canItemEditBlocks, createItemAsEntityInWorld, doesConsumeContainerItemWhenCrafted, doesContainerItemLeaveCraftingGrid, doZombiesConsume, getAnimationIcon, getBuoyancy, getCampfireBurnTime, getCanBeFedDirectlyIntoBrickOven, getCanBeFedDirectlyIntoCampfire, getCanItemBeSetOnFireOnUse, getCanItemStartFireOnUse, getChickenFoodValue, getColorFromItemStack, getContainerItem, getCreativeTab, getCustomItemEntity, getExhaustionOnUsedToHarvestBlock, getFurnaceBurnTime, getHasSubtypes, getHerbivoreFoodValue, getHopperFilterIcon, getIconFromDamage, getIconFromDamageForRenderPass, getIconIndex, getIconString, getInfernalMaxEnchantmentCost, getInfernalMaxNumEnchants, getIsRepairable, getItemDisplayName, getItemRightClickCooldown, getItemStackDisplayName, getItemStackLimit, getItemUseAction, getItemUseWarmupDuration, getMaxDamage, getMaxItemUseDuration, getMetadata, getModId, getMovingObjectPositionFromPlayer, getPigFoodValue, getPotionEffect, getRarity, getShareTag, getSpriteNumber, getStatName, getSubItems, getUnlocalizedName, getUnlocalizedName, getUnlocalizedNameInefficiently, getWolfHealAmount, hasContainerItem, hasCustomItemEntity, hasEffect, hideFromEMI, ignoreDamageWhenComparingDuringUse, initializeStackOnGiveCommand, isConsumedInCrafting, isDamageable, isDamagedInCrafting, isIncineratedInCrucible, isItemTool, isMap, isMultiUsePerClick, isPotionIngredient, isWolfFood, itemInteractionForEntity, onBrokenInCrafting, onDamagedInCrafting, onEaten, onItemRightClick, onItemUsedByBlockDispenser, onPlayerStoppedUsing, onUpdate, onUsedInCrafting, onUsedInCrafting, registerIcons, requiresMultipleRenderPasses, setAllAxesToBeEffectiveVsBlock, setAllPicksToBeEffectiveVsBlock, setAllShovelsToBeEffectiveVsBlock, setAsBasicChickenFood, setAsBasicHerbivoreFood, setAsBasicPigFood, setBuoyancy, setBuoyant, setChickenFoodValue, setContainerItem, setCreativeTab, setCustomItemEntity, setFull3D, setfurnaceburntime, setfurnaceburntime, setHasSubtypes, setHerbivoreFoodValue, setIncineratedInCrucible, setInfernalMaxEnchantmentCost, setInfernalMaxNumEnchants, setItemRightClickCooldown, setMaxDamage, setMaxStackSize, setModID, setNeutralBuoyant, setNonBuoyant, setNotIncineratedInCrucible, setPigFoodValue, setPotionEffect, setTextureName, setUnlocalizedName, shouldApplyAttributesWhenHeld, shouldApplyAttributesWhenWorn, shouldRotateAroundWhenRendering, updateUsingItem
-
Field Details
-
efficiencyOnProperMaterial
protected float efficiencyOnProperMaterial -
damageVsEntity
protected float damageVsEntity -
toolMaterial
-
-
Constructor Details
-
ToolItem
-
-
Method Details
-
hitEntity
public boolean hitEntity(ItemStack stack, EntityLivingBase defendingEntity, EntityLivingBase attackingEntity) Description copied from class:ItemCurrent implementations of this method in child classes do not use the entry argument beside ev. They just raise the damage on the stack. -
onBlockDestroyed
public boolean onBlockDestroyed(ItemStack stack, World world, int iBlockID, int i, int j, int k, EntityLivingBase usingEntity) - Overrides:
onBlockDestroyedin classItem
-
getItemAttributeModifiers
public com.google.common.collect.Multimap getItemAttributeModifiers()Description copied from class:ItemGets a map of item attribute modifiers, used by ItemSword to increase hit damage.- Overrides:
getItemAttributeModifiersin classItem
-
getItemEnchantability
public int getItemEnchantability()Description copied from class:ItemReturn the enchantability factor of the item, most of the time is based on material.- Overrides:
getItemEnchantabilityin classItem
-
isEnchantmentApplicable
- Overrides:
isEnchantmentApplicablein classItem
-
getStrVsBlock
- Overrides:
getStrVsBlockin classItem
-
isEfficientVsBlock
- Overrides:
isEfficientVsBlockin classItem
-
onCreated
Description copied from class:ItemCalled when item is crafted/smelted. Used only by maps so far. -
canItemBeUsedByPlayer
public boolean canItemBeUsedByPlayer(World world, int i, int j, int k, int iFacing, EntityPlayer player, ItemStack stack) Description copied from class:ItemMethod 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:
canItemBeUsedByPlayerin classItem
-
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:ItemCallback 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 -
isToolTypeEfficientVsBlockType
-
setDamageVsEntity
-
applyStandardEfficiencyModifiers
public void applyStandardEfficiencyModifiers() -
addCustomEfficiencyMultiplier
public void addCustomEfficiencyMultiplier(float multiplier) -
canToolStickInBlock
-
playPlacementSound
-
getCanBePlacedAsBlock
public boolean getCanBePlacedAsBlock() -
getVisualVerticalOffsetAsBlock
public float getVisualVerticalOffsetAsBlock()- Specified by:
getVisualVerticalOffsetAsBlockin interfacePlaceableAsItem
-
getVisualHorizontalOffsetAsBlock
public float getVisualHorizontalOffsetAsBlock()- Specified by:
getVisualHorizontalOffsetAsBlockin interfacePlaceableAsItem
-
getVisualRollOffsetAsBlock
public float getVisualRollOffsetAsBlock()- Specified by:
getVisualRollOffsetAsBlockin interfacePlaceableAsItem
-
getBlockBoundingBoxHeight
public float getBlockBoundingBoxHeight()- Specified by:
getBlockBoundingBoxHeightin interfacePlaceableAsItem
-
getBlockBoundingBoxWidth
public float getBlockBoundingBoxWidth()- Specified by:
getBlockBoundingBoxWidthin interfacePlaceableAsItem
-
isFull3D
@Environment(CLIENT) public boolean isFull3D()Description copied from class:ItemReturns True is the item is renderer in full 3D when hold.
-