2011-10-10 23:47:30 +00:00
|
|
|
--- ../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
|
2012-01-15 19:16:08 +00:00
|
|
|
@@ -1,10 +1,12 @@
|
2011-10-09 04:21:29 +00:00
|
|
|
package net.minecraft.src;
|
|
|
|
|
|
|
|
+import net.minecraft.src.forge.ForgeHooks;
|
2012-01-15 19:16:08 +00:00
|
|
|
+
|
|
|
|
public class ItemTool extends Item
|
2011-11-30 19:00:43 +00:00
|
|
|
{
|
|
|
|
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[])
|
2012-01-15 19:16:08 +00:00
|
|
|
@@ -32,6 +34,16 @@
|
2011-10-09 04:21:29 +00:00
|
|
|
return 1.0F;
|
|
|
|
}
|
|
|
|
|
2012-01-15 19:16:08 +00:00
|
|
|
+ /* FORGE: Overridden to allow custom tool effectiveness */
|
|
|
|
+ @Override
|
|
|
|
+ public float getStrVsBlock(ItemStack itemstack, Block block, int md)
|
|
|
|
+ {
|
|
|
|
+ if (ForgeHooks.isToolEffective(itemstack, block, md))
|
|
|
|
+ {
|
|
|
|
+ return efficiencyOnProperMaterial;
|
|
|
|
+ }
|
|
|
|
+ return getStrVsBlock(itemstack,block);
|
2011-10-09 04:21:29 +00:00
|
|
|
+ }
|
|
|
|
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
|
|
|
|
{
|
|
|
|
itemstack.damageItem(2, entityliving1);
|