Fix crash when clicking blocks with tools with no NBT

This commit is contained in:
Bernhard Bonigl committed 2015-01-06 11:46:41 +01:00
1 parent c94fc4310f
commit 491132cbae
2 files changed
+6

No files matched your search

@@ -594,6 +594,9 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IEq
@Override
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if(!stack.hasTagCompound())
return 0f;
NBTTagCompound tags = stack.getTagCompound();
if (tags.getCompoundTag("InfiTool").getBoolean("Broken"))
return 0.1f;
@@ -36,6 +36,9 @@ public abstract class Weapon extends ToolCore implements IBattlegearWeapon
@Override
public float getDigSpeed (ItemStack stack, Block block, int meta)
{
if(!stack.hasTagCompound())
return 0f;
if (stack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken"))
return 0.1f;