From b7a4bea52ec21692bec71c732fe7d760295e1fd1 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Fri, 30 Dec 2022 18:30:52 -0500 Subject: [PATCH] Revert dual hand behavior from /hat (#5205) Fixes https://github.com/EssentialsX/Essentials/issues/5202 --- .../java/com/earth2me/essentials/commands/Commandhat.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandhat.java b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandhat.java index 2dfc328f9..55ead04ce 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/commands/Commandhat.java +++ b/Essentials/src/main/java/com/earth2me/essentials/commands/Commandhat.java @@ -28,7 +28,7 @@ public class Commandhat extends EssentialsCommand { @Override protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length == 0 || (!args[0].contains("rem") && !args[0].contains("off") && !args[0].equalsIgnoreCase("0"))) { - final ItemStack hand = user.getItemInHand(); + final ItemStack hand = Inventories.getItemInMainHand(user.getBase()); if (hand == null || hand.getType() == Material.AIR) { user.sendMessage(tl("hatFail")); return; @@ -53,7 +53,7 @@ public class Commandhat extends EssentialsCommand { return; } inv.setHelmet(hand); - inv.setItemInHand(head); + Inventories.setItemInMainHand(user.getBase(), head); user.sendMessage(tl("hatPlaced")); return; }