aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/location
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-07-23 15:06:14 +0200
committernea <nea@nea.moe>2023-07-23 15:06:14 +0200
commitc4fc3d5b4783a4f9cdc2079736880af55e26ca65 (patch)
tree7506f1675a3b7c7b05be0ea621800265fef2d460 /src/main/java/com/thatgravyboat/skyblockhud/location
parentdcc604153eb806420a59c55a85f01773a5c0278f (diff)
downloadSkyblockHud-Death-Defied-c4fc3d5b4783a4f9cdc2079736880af55e26ca65.tar.gz
SkyblockHud-Death-Defied-c4fc3d5b4783a4f9cdc2079736880af55e26ca65.tar.bz2
SkyblockHud-Death-Defied-c4fc3d5b4783a4f9cdc2079736880af55e26ca65.zip
Add rift locations
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/location')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java13
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java9
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java40
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/RiftHandler.java13
4 files changed, 65 insertions, 10 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
index 10a98b0..7d63ed0 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
@@ -1,26 +1,27 @@
package com.thatgravyboat.skyblockhud.location;
-import static com.thatgravyboat.skyblockhud.handlers.MapHandler.Maps;
-
import com.thatgravyboat.skyblockhud.SkyblockHud;
import com.thatgravyboat.skyblockhud.handlers.MapHandler;
+import static com.thatgravyboat.skyblockhud.handlers.MapHandler.Maps;
+
public enum LocationCategory {
ERROR("error", 34),
- ISLAND("island", 43),
HUB("hub", 34, Maps.HUB),
+ ISLAND("island", 43),
+ PARK("park", 51, Maps.PARK),
+ JERRY("jerry", 59, Maps.JERRY),
BARN("barn", 67, Maps.BARN),
MUSHROOMDESERT("mushroomdesert", 75, Maps.MUSHROOM),
GOLDMINE("gold_mine", 83, Maps.GOLDMINE),
DEEPCAVERNS("deepcaverns", 91),
SPIDERSDEN("spiders_den", 99, Maps.SPIDERS),
- PARK("park", 51, Maps.PARK),
CRIMSON("crimson_isle", 107, Maps.CRIMSON),
DN("dungeonhub", 115, Maps.DN),
- JERRY("jerry", 59, Maps.JERRY),
THEEND("the_end", 123, Maps.THEEND),
DWARVENMINES("dwarven_mines", 131, Maps.DWARVEN),
- CRYSTALHOLLOWS("crystal_hollows", 139, Maps.CRYSTAL);
+ CRYSTALHOLLOWS("crystal_hollows", 139, Maps.CRYSTAL),
+ RIFT("rift", 147/*, TODO */);
private final String name;
private final int texturePos;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
index b4e63ec..299779f 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
@@ -11,7 +11,7 @@ public class LocationHandler {
private static Locations currentLocation = Locations.NONE;
- public static void handleLocation(String locationLine, boolean isGuesting) {
+ public static void handleLocation(String locationLine, boolean isGuesting, boolean isRift) {
String location = locationLine.replace(" ", "")
.toUpperCase(Locale.ENGLISH).trim()
.replaceAll("[^A-Za-z0-9]", "");
@@ -27,6 +27,8 @@ public class LocationHandler {
locations = Locations.GUESTISLAND;
} else if (isPlot) {
locations = Locations.THEGARDEN;
+ } else if (isRift) {
+ locations = Locations.get("RIFT_" + location);
} else {
locations = Locations.get(location);
}
@@ -45,10 +47,11 @@ public class LocationHandler {
@SubscribeEvent
public void onSidebarLineUpdate(SidebarLineUpdateEvent event) {
- if (event.rawLine.contains("\u23E3")) {
+ boolean isRift = event.rawLine.contains("ф");
+ if (event.rawLine.contains("⏣") || isRift) {
String objectiveName = event.objective.getDisplayName().replaceAll("(?i)\\u00A7.", "");
boolean isGuesting = objectiveName.toLowerCase(Locale.ENGLISH).endsWith("guest");
- LocationHandler.handleLocation(event.formattedLine, isGuesting);
+ LocationHandler.handleLocation(event.formattedLine, isGuesting, isRift);
}
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java b/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java
index ebe03bf..21370a4 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java
@@ -194,7 +194,45 @@ public enum Locations {
THEDUKEDOM("dukedom", "The Dukedom", LocationCategory.CRIMSON),
THRONEROOM("throneroom", "Throne Room", LocationCategory.CRIMSON),
CHIEFSHUT("chiefshut", "Chief's Hut", LocationCategory.CRIMSON),
- IGRUPANSCHICKENCOOP("igrupancoop", "Igrupan's Chicken Coop", LocationCategory.CRIMSON);
+ IGRUPANSCHICKENCOOP("igrupancoop", "Igrupan's Chicken Coop", LocationCategory.CRIMSON),
+
+ // RIFT
+ RIFT_WIZARDTOWER("wizardtower", "Wizard Tower", LocationCategory.RIFT),
+ RIFT_RIFTGALLERYENTRANCE("riftgalleryentrance", "Rift Gallery Entrance", LocationCategory.RIFT),
+ RIFT_RIFTGALLERY("riftgallery", "Rift Gallery", LocationCategory.RIFT),
+ RIFT_WYLDWOODS("wyldwoods", "Wyld Woods", LocationCategory.RIFT),
+ RIFT_THEBASTION("thebastion", "The Bastion", LocationCategory.RIFT),
+ RIFT_OTHERSIDE("otherside", "Otherside", LocationCategory.RIFT),
+ RIFT_SHIFTEDTAVERN("shiftedtavern", "Shifted Tavern", LocationCategory.RIFT),
+ RIFT_BROKENCAGE("brokencage", "Broken Cage", LocationCategory.RIFT),
+ RIFT_COLOSSEUM("colosseum", "Colosseum", LocationCategory.RIFT),
+ RIFT_AROUNDCOLOSSEUM("aroundcolosseum", "Around Colosseum", LocationCategory.RIFT),
+ RIFT_BLACKLAGOON("blacklagoon", "Black Lagoon", LocationCategory.RIFT),
+ RIFT_LAGOONCAVE("lagooncave", "Lagoon Cave", LocationCategory.RIFT),
+ RIFT_LAGOONHUT("lagoonhut", "Lagoon Hut", LocationCategory.RIFT),
+ RIFT_DREADFARM("dreadfarm", "Dreadfarm", LocationCategory.RIFT),
+ RIFT_WESTVILLAGE("westvillage", "West Village", LocationCategory.RIFT),
+ RIFT_LONELYTERRACE("lonelyterrace", "Lonely Terrace", LocationCategory.RIFT),
+ RIFT_VILLAGEPLAZA("villageplaza", "Village Plaza", LocationCategory.RIFT),
+ RIFT_TAYLORS("taylors", "Taylor's", LocationCategory.RIFT),
+ RIFT_BARRYCENTER("barrycenter", "Barry Center", LocationCategory.RIFT),
+ RIFT_INFESTEDHOUSE("infestedhouse", "Infested House", LocationCategory.RIFT),
+ RIFT_BOOKINABOOK("bookinabook","Book in a Book", LocationCategory.RIFT),
+ RIFT_HALFEATENCAVE("halfeatencave","Half-Eaten Cave", LocationCategory.RIFT),
+ RIFT_BARRYHQ("barryhq","Barry HQ", LocationCategory.RIFT),
+ RIFT_BARRIERSTREET("barrierstreet","Barrier Street", LocationCategory.RIFT),
+ RIFT_EMPTYBANK("emptybank","Empty Bank", LocationCategory.RIFT),
+ RIFT_YOURISLAND("yourisland","\"Your\" Island", LocationCategory.RIFT),
+ RIFT_MIRRORVERSE("mirrorverse","Mirrorverse", LocationCategory.RIFT),
+ RIFT_STILLGORECHTEAU("stillgorechateau","Stillgore Château", LocationCategory.RIFT),
+ RIFT_OUBLIETTE("oubliette","Oubliette", LocationCategory.RIFT),
+ RIFT_DJVUALLEY("dejavualley","Déjà Vu Alley", LocationCategory.RIFT),
+ RIFT_LIVINGCAVE("livingcave","Living Cave", LocationCategory.RIFT),
+ RIFT_LIVINGSTILLNESS("livingstillness","Living Stillness", LocationCategory.RIFT),
+ RIFT_PHOTONPATHWAY("photonpathway","Photon Pathway", LocationCategory.RIFT),
+ RIFT_MURDERHOUSE("murderhouse","Murder House", LocationCategory.RIFT),
+ ;
+
private final String name;
private final String displayName;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/RiftHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/RiftHandler.java
new file mode 100644
index 0000000..dfd225e
--- /dev/null
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/RiftHandler.java
@@ -0,0 +1,13 @@
+package com.thatgravyboat.skyblockhud.location;
+
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+
+public class RiftHandler {
+ @SubscribeEvent
+ public void onActionBar(ClientChatReceivedEvent event) {
+ if (event.type != 2) return;
+ // §741m30sф Left §b160/160✎ Mana
+ }
+
+}