Revert dual hand behavior from /hat (#5205)

Fixes https://github.com/EssentialsX/Essentials/issues/5202
This commit is contained in:
Josh Roy 2022-12-30 18:30:52 -05:00 committed by GitHub
parent ca71d93963
commit b7a4bea52e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}