--- ../src_base/minecraft_server/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000 @@ -4,6 +4,8 @@ package net.minecraft.src; +import java.util.Arrays; +import net.minecraft.src.forge.ForgeHooks; // Referenced classes of package net.minecraft.src: // Item, EnumToolMaterial, ItemStack, Block, @@ -13,8 +15,8 @@ { private Block blocksEffectiveAgainst[]; - protected float efficiencyOnProperMaterial; - private int damageVsEntity; + public float efficiencyOnProperMaterial; + public int damageVsEntity; protected EnumToolMaterial toolMaterial; protected ItemTool(int i, int j, EnumToolMaterial enumtoolmaterial, Block ablock[]) @@ -42,6 +44,14 @@ return 1.0F; } + /* FORGE: Overridden to allow custom tool effectiveness + */ + public float getStrVsBlock(ItemStack itemstack, Block block, int md) { + if(ForgeHooks.isToolEffective(itemstack,block,md)) + return efficiencyOnProperMaterial; + return getStrVsBlock(itemstack,block); + } + public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1) { itemstack.damageItem(2, entityliving1);