aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-11 22:58:53 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-07-11 22:58:53 -0230
commit06587d2dc10241ec6a8f5e21c8f55ae710c5cc8d (patch)
tree2a384a70822d75cff3a0706d34385f1bfd1a8763 /src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
parent901fd75034e6b013c543abc6d77f1f89fd7f3068 (diff)
downloadSkyblockHud-Death-Defied-06587d2dc10241ec6a8f5e21c8f55ae710c5cc8d.tar.gz
SkyblockHud-Death-Defied-06587d2dc10241ec6a8f5e21c8f55ae710c5cc8d.tar.bz2
SkyblockHud-Death-Defied-06587d2dc10241ec6a8f5e21c8f55ae710c5cc8d.zip
Added crystal hollow waypoints
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
index d4a0d0e..7796799 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
@@ -1,9 +1,12 @@
package com.thatgravyboat.skyblockhud.location;
+import com.thatgravyboat.skyblockhud.api.events.LocationChangeEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
-import java.util.Locale;
+import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import java.util.Locale;
+
public class LocationHandler {
private static Locations currentLocation = Locations.NONE;
@@ -20,10 +23,6 @@ public class LocationHandler {
}
}
- public static void setCurrentLocation(String location) {
- currentLocation = Locations.get(location);
- }
-
public static void setCurrentLocation(Locations location) {
currentLocation = location;
}
@@ -35,7 +34,12 @@ public class LocationHandler {
public static void handleLocation(String locationLine) {
String location = locationLine.replace(" ", "").toUpperCase(Locale.ENGLISH).trim();
if (location.startsWith("THECATACOMBS")) {
+ MinecraftForge.EVENT_BUS.post(new LocationChangeEvent(currentLocation, Locations.CATACOMBS));
currentLocation = Locations.CATACOMBS;
- } else setCurrentLocation(location.replaceAll("[^A-Za-z0-9]", ""));
+ } else {
+ Locations locations = Locations.get(location.replaceAll("[^A-Za-z0-9]", ""));
+ MinecraftForge.EVENT_BUS.post(new LocationChangeEvent(currentLocation, locations));
+ currentLocation = locations;
+ }
}
}