Harvest Level returns 0 for deactivated tools
This commit is contained in:
parent
678870c8f6
commit
82f2dab8c1
|
@ -227,13 +227,13 @@ public class BoundAxe extends ItemAxe 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");
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ public class BoundAxe extends ItemAxe implements IBindable
|
|||
@Override
|
||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||
{
|
||||
if ("axe".equals(toolClass))
|
||||
if (getActivated(stack) && "axe".equals(toolClass))
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
|
|
@ -235,13 +235,13 @@ public class BoundPickaxe extends ItemPickaxe 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");
|
||||
}
|
||||
|
||||
|
@ -331,7 +331,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
|
|||
@Override
|
||||
public int getHarvestLevel(ItemStack stack, String toolClass)
|
||||
{
|
||||
if ("pickaxe".equals(toolClass))
|
||||
if (getActivated(stack) && "pickaxe".equals(toolClass))
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue