mirror of
https://github.com/GTNewHorizons/BloodMagic.git
synced 2026-11-18 19:29:34 +00:00
Merge pull request #258 from hilburn/master
Fixes Harvest Level of Deactivated Items
This commit is contained in:
commit
72312f2cdf
3 files changed
+12
-12
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user