Fix Bound Tool Harvest Levels
This way, they'll be 5 by default, but since they now follow Forge's normal way of getting/setting the harvest level on tools, other mods - such as Iguana Tinker Tweaks - can alter their harvest levels as desired. When the tools are not activated, they will now return a -1 instead of 0, which results in not being able to be used as a tool at all, rather than the equivalent of a wooden tool.
This commit is contained in:
parent
277cd0742e
commit
eaa20628ce
3 changed files with 6 additions and 18 deletions
|
@ -46,6 +46,7 @@ public class BoundAxe extends ItemAxe implements IBindable
|
||||||
this.damageVsEntity = 5;
|
this.damageVsEntity = 5;
|
||||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||||
setEnergyUsed(5);
|
setEnergyUsed(5);
|
||||||
|
this.setHarvestLevel("axe", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnergyUsed(int i)
|
public void setEnergyUsed(int i)
|
||||||
|
@ -321,11 +322,6 @@ public class BoundAxe extends ItemAxe implements IBindable
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||||
{
|
{
|
||||||
if (getActivated(stack) && "axe".equals(toolClass))
|
return getActivated(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
||||||
{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
||||||
this.damageVsEntity = 5;
|
this.damageVsEntity = 5;
|
||||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||||
this.setEnergyUsed(5);
|
this.setEnergyUsed(5);
|
||||||
|
setHarvestLevel("pickaxe", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnergyUsed(int i)
|
public void setEnergyUsed(int i)
|
||||||
|
@ -351,11 +352,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||||
{
|
{
|
||||||
if (getActivated(stack) && "pickaxe".equals(toolClass))
|
return getActivated(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
||||||
{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class BoundShovel extends ItemSpade implements IBindable
|
||||||
this.damageVsEntity = 5;
|
this.damageVsEntity = 5;
|
||||||
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
|
||||||
setEnergyUsed(5);
|
setEnergyUsed(5);
|
||||||
|
setHarvestLevel("shovel", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnergyUsed(int i)
|
public void setEnergyUsed(int i)
|
||||||
|
@ -332,11 +333,6 @@ public class BoundShovel extends ItemSpade implements IBindable
|
||||||
@Override
|
@Override
|
||||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||||
{
|
{
|
||||||
if (getActivated(stack) && "shovel".equals(toolClass))
|
return getActivated(stack) ? super.getHarvestLevel(stack, toolClass) : -1;
|
||||||
{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue