Use == operator for comparing EquipmentSlot values. Fixes #361

Because the == operator is null safe, we don't need to worry about null checking.
This commit is contained in:
Andreas Troelsen 2017-03-11 13:59:37 +01:00
parent f212c657b0
commit 2fdfd64ddf
2 changed files with 2 additions and 2 deletions

View File

@ -978,7 +978,7 @@ public class ArenaListener
}
// Bail if off-hand or if there's no block involved.
if (event.getHand().equals(EquipmentSlot.OFF_HAND) || !event.hasBlock())
if (event.getHand() == EquipmentSlot.OFF_HAND || !event.hasBlock())
return;
// Iron block

View File

@ -254,7 +254,7 @@ public class SetupCommand implements Command, Listener {
Player p = event.getPlayer();
if (!p.equals(player)) return;
if (event.getHand().equals(EquipmentSlot.OFF_HAND)) return;
if (event.getHand() == EquipmentSlot.OFF_HAND) return;
ItemStack tool = p.getItemInHand();
if (!isTool(tool)) return;