Skip to content

Commit

Permalink
Fix crash when clicking blocks with tools with no NBT
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Jan 6, 2015
1 parent c94fc43 commit 491132c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/tconstruct/library/tools/ToolCore.java
Expand Up @@ -594,6 +594,9 @@ public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block,
@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;
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/tconstruct/library/tools/Weapon.java
Expand Up @@ -36,6 +36,9 @@ protected float effectiveSpeed ()
@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;

Expand Down

0 comments on commit 491132c

Please sign in to comment.