From 5742dd623eb43188c50fa1bc571402bc49c1ec0d Mon Sep 17 00:00:00 2001 From: Andrew Wong <42793301+md5sha256@users.noreply.github.com> Date: Sun, 4 Aug 2024 21:51:44 +1000 Subject: [PATCH] Fix as me command to have the player arg be properly optional --- .../main/java/me/wiefferink/areashop/commands/MeCommand.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AreaShop/src/main/java/me/wiefferink/areashop/commands/MeCommand.java b/AreaShop/src/main/java/me/wiefferink/areashop/commands/MeCommand.java index 37f77d4d..ffd19ac8 100644 --- a/AreaShop/src/main/java/me/wiefferink/areashop/commands/MeCommand.java +++ b/AreaShop/src/main/java/me/wiefferink/areashop/commands/MeCommand.java @@ -76,6 +76,10 @@ private void handleCommand(@Nonnull CommandContext context) if (!sender.hasPermission("areashop.me")) { throw new AreaShopCommandException("me-noPermission"); } + if (!context.contains(KEY_PLAYER)) { + RegionInfoUtil.showRegionInfo(this.messageBridge, this.fileManager, sender, sender); + return; + } this.offlinePlayerHelper.lookupOfflinePlayerAsync(context.get(KEY_PLAYER)) .whenCompleteAsync((offlinePlayer, exception) -> { if (exception != null) {