Skip to content

Commit 640ed24

Browse files
Update Essentials/src/main/java/com/earth2me/essentials/commands/Commandrecipe.java
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
1 parent 503e5aa commit 640ed24

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Essentials/src/main/java/com/earth2me/essentials/commands/Commandrecipe.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,12 @@ public void run(final Server server, final CommandSource sender, final String co
5656
final ItemStack itemType;
5757

5858
if (args[0].equalsIgnoreCase("hand")) {
59-
final User user = ess.getUser(sender.getPlayer());
60-
if (user == null) {
59+
if (!sender.isPlayer()) {
6160
throw new Exception(tl("consoleCannotUseCommand"));
6261
}
63-
final Material item = user.getItemInHand().getType();
64-
65-
itemType = ess.getItemDb().get(item.toString());
62+
final User user = sender.getUser(ess);
63+
64+
itemType = user.getItemInHand();
6665
} else {
6766
itemType = ess.getItemDb().get(args[0]);
6867
}

0 commit comments

Comments
 (0)