Replace deprecated getItemInHand() calls in SetupCommand.

This commit is contained in:
Andreas Troelsen 2018-07-04 01:57:30 +02:00
parent d0eb1cc487
commit 25dc6b577b

View File

@ -241,7 +241,7 @@ public class SetupCommand implements Command, Listener {
Player p = event.getPlayer();
if (!p.equals(player)) return;
ItemStack tool = p.getItemInHand();
ItemStack tool = p.getInventory().getItemInMainHand();
if (!isTool(tool)) return;
event.setCancelled(true);
@ -264,7 +264,7 @@ public class SetupCommand implements Command, Listener {
if (event.getHand() == EquipmentSlot.OFF_HAND) return;
ItemStack tool = p.getItemInHand();
ItemStack tool = p.getInventory().getItemInMainHand();
if (!isTool(tool)) return;
String name = tool.getItemMeta().getDisplayName();