Harvest Level returns 0 for deactivated tools

This commit is contained in:
hilburn 2015-02-18 19:54:20 +00:00
parent 678870c8f6
commit 82f2dab8c1
3 changed files with 12 additions and 12 deletions

View file

@ -233,13 +233,13 @@ public class BoundShovel extends ItemSpade implements IBindable
public boolean getActivated(ItemStack par1ItemStack)
{
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
if (itemTag == null)
if (!par1ItemStack.hasTagCompound())
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
return itemTag.getBoolean("isActive");
}
@ -330,7 +330,7 @@ public class BoundShovel extends ItemSpade implements IBindable
@Override
public int getHarvestLevel(ItemStack stack, String toolClass)
{
if ("shovel".equals(toolClass))
if (getActivated(stack) && "shovel".equals(toolClass))
{
return 5;
}