From 9df65bbd49fad2f413576a2c7ff565f2d2a61ca6 Mon Sep 17 00:00:00 2001 From: Emma Waffle Date: Fri, 16 Jul 2021 16:16:14 -0400 Subject: [PATCH] fix home command issue say we have the scenario of /home 1 on smp1 and /home 2 on smp2 if the player were to do /home while on smp2, they would be sent to the 2nd home in vanilla; without this fix, they're sent to home on smp1. --- gradle.properties | 2 +- .../java/dev/frydae/emcutils/listeners/CommandListener.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index fbe8428..7edbdb6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ yarn_mappings=14 loader_version=0.11.6 fabric_version=0.37.0+1.17 # Mod Properties -mod_version=2.1.3 +mod_version=2.1.4 # Dependencies modmenu_version=2.0.2 lombok_version=1.18.20 diff --git a/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java b/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java index 5bcdc6e..76467dd 100644 --- a/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java +++ b/src/main/java/dev/frydae/emcutils/listeners/CommandListener.java @@ -21,7 +21,7 @@ private static ActionResult handleResidenceHomeCommand(ClientPlayerEntity player int num = 1; String loc = ""; - if (args != null) { + if (args.size() != 0) { if (args.size() == 1) { if (NumberUtils.isParsable(args.get(0))) { num = Integer.parseInt(args.get(0)); @@ -34,7 +34,7 @@ private static ActionResult handleResidenceHomeCommand(ClientPlayerEntity player loc = args.get(1); } } - } + } else return ActionResult.PASS; String resName = Util.getPlayer().getEntityName() + (num > 1 ? "-" + num : ""); // FIXME: this is what causes #33