Fix bound tools not checking if they're bound (#1114)

(cherry picked from commit 3134f6b)
This commit is contained in:
Nicholas Ignoffo 2017-03-28 18:40:24 -07:00
parent 692c69865a
commit dd2c6915f3
2 changed files with 10 additions and 0 deletions

View file

@ -73,6 +73,11 @@ public class ItemBoundSword extends ItemSword implements IBindable, IActivatable
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected)
{
if (Strings.isNullOrEmpty(getOwnerUUID(stack))) {
setActivatedState(stack, false);
return;
}
if (entity instanceof EntityPlayer && getActivated(stack) && world.getTotalWorldTime() % 80 == 0)
NetworkHelper.getSoulNetwork(getOwnerUUID(stack)).syphonAndDamage((EntityPlayer) entity, 20);
}

View file

@ -89,6 +89,11 @@ public class ItemBoundTool extends ItemTool implements IBindable, IActivatable
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot, boolean isSelected)
{
if (Strings.isNullOrEmpty(getOwnerUUID(stack))) {
setActivatedState(stack, false);
return;
}
if (entity instanceof EntityPlayer && getActivated(stack) && isSelected && getBeingHeldDown(stack) && stack == ((EntityPlayer) entity).getActiveItemStack())
{
EntityPlayer player = (EntityPlayer) entity;