From f11138dedc9ea94533ca49cc3b4c84ff609d6387 Mon Sep 17 00:00:00 2001 From: KingRainbow44 Date: Mon, 18 Apr 2022 22:31:31 -0400 Subject: [PATCH] Fix bugs with commands --- .../java/emu/grasscutter/commands/PlayerCommands.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/emu/grasscutter/commands/PlayerCommands.java b/src/main/java/emu/grasscutter/commands/PlayerCommands.java index e8816a188..df927dbcc 100644 --- a/src/main/java/emu/grasscutter/commands/PlayerCommands.java +++ b/src/main/java/emu/grasscutter/commands/PlayerCommands.java @@ -41,7 +41,7 @@ public final class PlayerCommands { case 1: try { item = Integer.parseInt(args.get(0)); - target = player.getId(); + target = player.getAccount().getPlayerId(); } catch (NumberFormatException ignored) { // TODO: Parse from item name using GM Handbook. CommandHandler.sendMessage(player, "Invalid item id."); @@ -147,7 +147,7 @@ public final class PlayerCommands { @Override public void execute(GenshinPlayer player, List args) { if(args.size() < 1) { - CommandHandler.sendMessage(null, "Usage: drop [amount]"); + CommandHandler.sendMessage(player, "Usage: drop [amount]"); return; } @@ -157,7 +157,7 @@ public final class PlayerCommands { ItemData itemData = GenshinData.getItemDataMap().get(item); if(itemData == null) { - CommandHandler.sendMessage(null, "Invalid item id."); return; + CommandHandler.sendMessage(player, "Invalid item id."); return; } if (itemData.isEquip()) { @@ -172,7 +172,7 @@ public final class PlayerCommands { player.getWorld().addEntity(entity); } } catch (NumberFormatException ignored) { - CommandHandler.sendMessage(null, "Invalid item or player ID."); + CommandHandler.sendMessage(player, "Invalid item or player ID."); } } }