mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
36 lines
1.2 KiB
Diff
36 lines
1.2 KiB
Diff
--- ../src_base/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000
|
|
+++ ../src_work/minecraft/net/minecraft/src/ItemTool.java 0000-00-00 00:00:00.000000000 -0000
|
|
@@ -1,10 +1,12 @@
|
|
package net.minecraft.src;
|
|
|
|
+import net.minecraft.src.forge.ForgeHooks;
|
|
+
|
|
public class ItemTool extends Item
|
|
{
|
|
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[])
|
|
@@ -32,6 +34,17 @@
|
|
return 1.0F;
|
|
}
|
|
|
|
+ /* 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);
|
|
+ }
|
|
+
|
|
public boolean hitEntity(ItemStack itemstack, EntityLiving entityliving, EntityLiving entityliving1)
|
|
{
|
|
itemstack.damageItem(2, entityliving1);
|