diff options
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/utils')
| -rw-r--r-- | src/main/java/de/hysky/skyblocker/utils/Utils.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/utils/Utils.java b/src/main/java/de/hysky/skyblocker/utils/Utils.java index 00028011..62a3b897 100644 --- a/src/main/java/de/hysky/skyblocker/utils/Utils.java +++ b/src/main/java/de/hysky/skyblocker/utils/Utils.java @@ -74,6 +74,8 @@ public class Utils { private static long clientWorldJoinTime = 0; private static boolean sentLocRaw = false; private static boolean canSendLocRaw = false; + //This is required to prevent the location change event from being fired twice. + private static boolean locationChanged = true; private static String mayor = ""; @@ -383,6 +385,7 @@ public class Utils { MessageScheduler.INSTANCE.sendMessageAfterCooldown("/locraw"); sentLocRaw = true; canSendLocRaw = false; + locationChanged = true; } } else { resetLocRawInfo(); @@ -413,6 +416,11 @@ public class Utils { if (locRaw.has("map")) { map = locRaw.get("map").getAsString(); } + + if (locationChanged) { + SkyblockEvents.LOCATION_CHANGE.invoker().onSkyblockLocationChange(location); + locationChanged = false; + } } /** |
