aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/location
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-06 19:09:11 -0230
committerGitHub <noreply@github.com>2021-07-06 19:09:11 -0230
commit93248d28d6b314b42f6b0d82164975343b214ece (patch)
treee3e06c24454080f059355133d633e5a076d85ad3 /src/main/java/com/thatgravyboat/skyblockhud/location
parent91464c8f433e8bf323932ac956678971207b607e (diff)
parent804767ebfc26e2a1252bc327def02389b35dfc6e (diff)
downloadSkyblockHud-Death-Defied-93248d28d6b314b42f6b0d82164975343b214ece.tar.gz
SkyblockHud-Death-Defied-93248d28d6b314b42f6b0d82164975343b214ece.tar.bz2
SkyblockHud-Death-Defied-93248d28d6b314b42f6b0d82164975343b214ece.zip
Merge pull request #2 from ThatGravyBoat/prettier
Add prettier settings and format code
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/location')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/DwarvenMineHandler.java70
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/EndIslandHandler.java21
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/FarmingIslandHandler.java7
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java44
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java43
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java31
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java203
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java14
8 files changed, 220 insertions, 213 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/DwarvenMineHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/DwarvenMineHandler.java
index 32f6c80..3b17899 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/DwarvenMineHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/DwarvenMineHandler.java
@@ -2,12 +2,11 @@ package com.thatgravyboat.skyblockhud.location;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Arrays;
import java.util.Locale;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class DwarvenMineHandler {
@@ -19,7 +18,7 @@ public class DwarvenMineHandler {
public int x;
public String displayName;
- Event(int x, String displayName){
+ Event(int x, String displayName) {
this.x = x;
this.displayName = displayName;
}
@@ -33,53 +32,52 @@ public class DwarvenMineHandler {
private static final DecimalFormat formatter = new DecimalFormat("#,###", DecimalFormatSymbols.getInstance(Locale.CANADA));
- public static String getMithrilFormatted(){
+ public static String getMithrilFormatted() {
String output = formatter.format(mithril);
- if (output.equals(".0")) output = "0.0";
- else if (output.equals(",0")) output = "0,0";
+ if (output.equals(".0")) output = "0.0"; else if (output.equals(",0")) output = "0,0";
return output;
}
- public static void parseMithril(String line){
- try{
+ public static void parseMithril(String line) {
+ try {
mithril = Integer.parseInt(line.toLowerCase().replace("mithril powder:", "").trim());
- }catch (Exception ignored){}
+ } catch (Exception ignored) {}
}
@SubscribeEvent
- public void onSidebarLineUpdate(SidebarLineUpdateEvent event){
- if (event.formattedLine.toLowerCase().contains("mithril")){
- try{
- mithril = Integer.parseInt(event.formattedLine.toLowerCase().replace("mithril:","").trim());
- }catch (Exception ignored){}
+ public void onSidebarLineUpdate(SidebarLineUpdateEvent event) {
+ if (event.formattedLine.toLowerCase().contains("mithril")) {
+ try {
+ mithril = Integer.parseInt(event.formattedLine.toLowerCase().replace("mithril:", "").trim());
+ } catch (Exception ignored) {}
}
- if (event.formattedLine.toLowerCase().contains("event")){
- if (event.formattedLine.toLowerCase().contains("raffle")){
+ if (event.formattedLine.toLowerCase().contains("event")) {
+ if (event.formattedLine.toLowerCase().contains("raffle")) {
DwarvenMineHandler.currentEvent = Event.TICKET;
- }else if (event.formattedLine.toLowerCase().contains("goblin raid")){
+ } else if (event.formattedLine.toLowerCase().contains("goblin raid")) {
DwarvenMineHandler.currentEvent = Event.GOBLIN;
}
}
- if (DwarvenMineHandler.currentEvent != Event.NONE){
- if (DwarvenMineHandler.currentEvent == Event.TICKET && event.formattedLine.toLowerCase().contains("tickets:")){
- if (event.formattedLine.toLowerCase().contains("pool:")){
- try{
- eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("pool:","").trim().split("/")[0].trim());
- }catch (Exception ignored){}
- }else if (event.formattedLine.toLowerCase().contains("tickets:")){
- try{
+ if (DwarvenMineHandler.currentEvent != Event.NONE) {
+ if (DwarvenMineHandler.currentEvent == Event.TICKET && event.formattedLine.toLowerCase().contains("tickets:")) {
+ if (event.formattedLine.toLowerCase().contains("pool:")) {
+ try {
+ eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("pool:", "").trim().split("/")[0].trim());
+ } catch (Exception ignored) {}
+ } else if (event.formattedLine.toLowerCase().contains("tickets:")) {
+ try {
eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("tickets:", "").split("\\(")[0].trim());
- }catch (Exception ignored){}
+ } catch (Exception ignored) {}
}
- }else if (DwarvenMineHandler.currentEvent == Event.GOBLIN){
- if (event.formattedLine.toLowerCase().contains("remaining:")){
- try{
- eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("goblins","").replace("remaining:","").trim());
- }catch (Exception ignored){}
- }else if (event.formattedLine.toLowerCase().contains("your kills:") && !event.formattedLine.toLowerCase().contains("(")){
- try{
- eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("your kills:","").trim());
- }catch (Exception ignored){}
+ } else if (DwarvenMineHandler.currentEvent == Event.GOBLIN) {
+ if (event.formattedLine.toLowerCase().contains("remaining:")) {
+ try {
+ eventMax = Integer.parseInt(event.formattedLine.toLowerCase().replace("goblins", "").replace("remaining:", "").trim());
+ } catch (Exception ignored) {}
+ } else if (event.formattedLine.toLowerCase().contains("your kills:") && !event.formattedLine.toLowerCase().contains("(")) {
+ try {
+ eventProgress = Integer.parseInt(event.formattedLine.toLowerCase().replace("your kills:", "").trim());
+ } catch (Exception ignored) {}
}
}
}
@@ -88,7 +86,7 @@ public class DwarvenMineHandler {
@SubscribeEvent
public void onSidebarPost(SidebarPostEvent event) {
String arrayString = Arrays.toString(event.arrayScores);
- if (!arrayString.toLowerCase().contains("event:")){
+ if (!arrayString.toLowerCase().contains("event:")) {
DwarvenMineHandler.currentEvent = Event.NONE;
DwarvenMineHandler.eventProgress = 0;
DwarvenMineHandler.eventMax = 0;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/EndIslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/EndIslandHandler.java
index e8be465..505db19 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/EndIslandHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/EndIslandHandler.java
@@ -1,6 +1,7 @@
package com.thatgravyboat.skyblockhud.location;
public class EndIslandHandler {
+
public enum dragonTypes {
PROTECTOR("Protector Dragon", 9000000),
OLD("Old Dragon", 15000000),
@@ -14,12 +15,12 @@ public class EndIslandHandler {
private final String displayName;
private final int maxHealth;
- dragonTypes(String displayName, int maxHealth){
+ dragonTypes(String displayName, int maxHealth) {
this.displayName = displayName;
this.maxHealth = maxHealth;
}
- public String getDisplayName(){
+ public String getDisplayName() {
return this.displayName;
}
@@ -27,20 +28,26 @@ public class EndIslandHandler {
return this.maxHealth;
}
- public static dragonTypes findDragon(String input){
- if (input.contains(" ")){
+ public static dragonTypes findDragon(String input) {
+ if (input.contains(" ")) {
try {
return dragonTypes.valueOf(input.toLowerCase().replace("dragon", "").replace(" ", "").toUpperCase());
- } catch(IllegalArgumentException ignored) {
+ } catch (IllegalArgumentException ignored) {
return NODRAGON;
}
} else {
- try { return dragonTypes.valueOf(input); } catch(IllegalArgumentException ignored) { return NODRAGON; }
+ try {
+ return dragonTypes.valueOf(input);
+ } catch (IllegalArgumentException ignored) {
+ return NODRAGON;
+ }
}
}
}
private static dragonTypes currentDragon = dragonTypes.NODRAGON;
- public static void setCurrentDragon(dragonTypes dragon) { currentDragon = dragon; }
+ public static void setCurrentDragon(dragonTypes dragon) {
+ currentDragon = dragon;
+ }
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmingIslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmingIslandHandler.java
index 03a698b..a4abaae 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmingIslandHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmingIslandHandler.java
@@ -1,9 +1,8 @@
package com.thatgravyboat.skyblockhud.location;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
import java.util.Arrays;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class FarmingIslandHandler {
@@ -16,13 +15,13 @@ public class FarmingIslandHandler {
if (isTracking && location == Locations.NONE) {
for (int i = 0; i < event.scores.size(); i++) {
String line = event.scores.get(i);
- if (line.toLowerCase().contains("tracker mob location:") && i > 2){
+ if (line.toLowerCase().contains("tracker mob location:") && i > 2) {
location = Locations.get(event.scores.get(i - 1).toLowerCase());
break;
}
}
}
- if (!isTracking && location != Locations.NONE){
+ if (!isTracking && location != Locations.NONE) {
location = Locations.NONE;
}
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java
index d6ab81e..2e2fae1 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java
@@ -5,9 +5,8 @@ import com.thatgravyboat.skyblockhud.api.events.ProfileSwitchedEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
import com.thatgravyboat.skyblockhud.api.events.SidebarPostEvent;
import com.thatgravyboat.skyblockhud.handlers.CurrencyHandler;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
import java.util.Arrays;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class IslandHandler {
@@ -15,33 +14,43 @@ public class IslandHandler {
public static boolean hadFlightTime;
public static int redstone;
- public static boolean hadRedstone;
+ public static boolean hadRedstone;
@SubscribeEvent
- public void onSidebarLineUpdate(SidebarLineUpdateEvent event){
+ public void onSidebarLineUpdate(SidebarLineUpdateEvent event) {
hadFlightTime = checkFlightDuration(event.formattedLine);
hadRedstone = checkRestone(event.formattedLine);
}
@SubscribeEvent
- public void onProfileSwitch(ProfileSwitchedEvent event){
+ public void onProfileSwitch(ProfileSwitchedEvent event) {
flightTime = 0;
}
- public static boolean checkFlightDuration(String formatedScoreboardLine){
- if (LocationHandler.getCurrentLocation() == Locations.YOURISLAND && Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()).contains("flight duration:")){
+ public static boolean checkFlightDuration(String formatedScoreboardLine) {
+ if (LocationHandler.getCurrentLocation() == Locations.YOURISLAND && Utils.removeColor(formatedScoreboardLine.toLowerCase().trim()).contains("flight duration:")) {
String timeString = formatedScoreboardLine.toLowerCase().replace("flight duration:", "").replace(" ", "");
String[] times = timeString.split(":");
- if (times.length == 2){
+ if (times.length == 2) {
int s = 0;
- try { s += Integer.parseInt(times[0]) * 60; } catch (NumberFormatException ignored){}
- try { s += Integer.parseInt(times[1]); } catch (NumberFormatException ignored){}
+ try {
+ s += Integer.parseInt(times[0]) * 60;
+ } catch (NumberFormatException ignored) {}
+ try {
+ s += Integer.parseInt(times[1]);
+ } catch (NumberFormatException ignored) {}
flightTime = s - 1;
- } else if (times.length == 3){
+ } else if (times.length == 3) {
int s = 0;
- try { s += Integer.parseInt(times[0]) * 3600; } catch (NumberFormatException ignored){}
- try { s += Integer.parseInt(times[1]) * 60; } catch (NumberFormatException ignored){}
- try { s += Integer.parseInt(times[2]); } catch (NumberFormatException ignored){}
+ try {
+ s += Integer.parseInt(times[0]) * 3600;
+ } catch (NumberFormatException ignored) {}
+ try {
+ s += Integer.parseInt(times[1]) * 60;
+ } catch (NumberFormatException ignored) {}
+ try {
+ s += Integer.parseInt(times[2]);
+ } catch (NumberFormatException ignored) {}
flightTime = s - 1;
}
return true;
@@ -49,13 +58,12 @@ public class IslandHandler {
return false;
}
- public static boolean checkRestone(String formatedScoreboardLine){
+ public static boolean checkRestone(String formatedScoreboardLine) {
if (LocationHandler.getCurrentLocation() == Locations.YOURISLAND) {
- if (formatedScoreboardLine.toLowerCase().contains("redstone:"))
- return true;
+ if (formatedScoreboardLine.toLowerCase().contains("redstone:")) return true;
try {
redstone = formatedScoreboardLine.toLowerCase().contains("redstone:") ? Integer.parseInt(Utils.removeWhiteSpaceAndRemoveWord(formatedScoreboardLine, "redstone:")) : 0;
- }catch (Exception ignored){}
+ } catch (Exception ignored) {}
}
return false;
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
index 817645d..a337f3d 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationCategory.java
@@ -1,46 +1,49 @@
package com.thatgravyboat.skyblockhud.location;
-import com.thatgravyboat.skyblockhud.handlers.MapHandler;
import static com.thatgravyboat.skyblockhud.handlers.MapHandler.Maps;
-public enum LocationCategory {
+import com.thatgravyboat.skyblockhud.handlers.MapHandler;
+public enum LocationCategory {
ERROR("error", 34),
- ISLAND("island",43),
- HUB("hub",34, Maps.HUB),
- BARN("barn",67, Maps.BARN),
- MUSHROOMDESERT("mushroomdesert",75, Maps.MUSHROOM),
- GOLDMINE("gold_mine",83),
- DEEPCAVERNS("deepcaverns",91),
- SPIDERSDEN("spiders_den",99, Maps.SPIDERS),
- PARK("park",51, Maps.PARK),
- FORTRESS("fortress",107, Maps.NETHER),
- DUNGEONHUB("dungeonhub",115),
- JERRY("jerry",59),
- THEEND("the_end",123),
+ ISLAND("island", 43),
+ HUB("hub", 34, Maps.HUB),
+ BARN("barn", 67, Maps.BARN),
+ MUSHROOMDESERT("mushroomdesert", 75, Maps.MUSHROOM),
+ GOLDMINE("gold_mine", 83),
+ DEEPCAVERNS("deepcaverns", 91),
+ SPIDERSDEN("spiders_den", 99, Maps.SPIDERS),
+ PARK("park", 51, Maps.PARK),
+ FORTRESS("fortress", 107, Maps.NETHER),
+ DUNGEONHUB("dungeonhub", 115),
+ JERRY("jerry", 59),
+ THEEND("the_end", 123),
DWARVENMINES("dwarven_mines", 131, Maps.DWARVEN),
CRYSTALHOLLOWS("crystal_hollows", 131);
-
private final String name;
private final int texturePos;
private final MapHandler.Maps map;
- LocationCategory(String name, int texturePos){
+ LocationCategory(String name, int texturePos) {
this(name, texturePos, null);
}
- LocationCategory(String name, int texturePos, MapHandler.Maps map){
+ LocationCategory(String name, int texturePos, MapHandler.Maps map) {
this.name = name;
this.texturePos = texturePos;
this.map = map;
}
- public String getName(){
+ public String getName() {
return this.name;
}
- public int getTexturePos(){
+
+ public int getTexturePos() {
return this.texturePos;
}
- public MapHandler.Maps getMap() { return this.map; }
+
+ public MapHandler.Maps getMap() {
+ return this.map;
+ }
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
index 274baf8..bf55db6 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/LocationHandler.java
@@ -1,54 +1,51 @@
package com.thatgravyboat.skyblockhud.location;
import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class LocationHandler {
private static Locations currentLocation = Locations.NONE;
private static final List<String> UndocumentedLocations = new ArrayList<>();
-
@SubscribeEvent
- public void onSidebarLineUpdate(SidebarLineUpdateEvent event){
+ public void onSidebarLineUpdate(SidebarLineUpdateEvent event) {
if (event.rawLine.contains("\u23E3")) {
String objectiveName = event.objective.getDisplayName().replaceAll("(?i)\\u00A7.", "");
- if (objectiveName.toLowerCase(Locale.ENGLISH).endsWith("guest")){
+ if (objectiveName.toLowerCase(Locale.ENGLISH).endsWith("guest")) {
LocationHandler.setCurrentLocation(Locations.GUESTISLAND);
- }else {
+ } else {
LocationHandler.handleLocation(event.formattedLine);
}
}
}
- public static void setCurrentLocation(String location){
+ public static void setCurrentLocation(String location) {
currentLocation = Locations.get(location);
}
- public static void setCurrentLocation(Locations location){
+ public static void setCurrentLocation(Locations location) {
currentLocation = location;
}
- public static Locations getCurrentLocation(){ return currentLocation; }
+ public static Locations getCurrentLocation() {
+ return currentLocation;
+ }
- public static void handleLocation(String locationLine){
+ public static void handleLocation(String locationLine) {
String location = locationLine.replace(" ", "").toUpperCase(Locale.ENGLISH).trim();
- if (location.startsWith("THECATACOMBS")){
+ if (location.startsWith("THECATACOMBS")) {
currentLocation = Locations.CATACOMBS;
- }
- else setCurrentLocation(location.replaceAll("[^A-Za-z0-9]", ""));
+ } else setCurrentLocation(location.replaceAll("[^A-Za-z0-9]", ""));
}
-
- public static void reportUndocumentedLocation(String locationId){
- if (!UndocumentedLocations.contains(locationId)){
+ public static void reportUndocumentedLocation(String locationId) {
+ if (!UndocumentedLocations.contains(locationId)) {
UndocumentedLocations.add(locationId);
System.out.println("Missing Location value for: " + locationId);
}
}
-
}
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java b/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java
index 887ac11..74e7ae1 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/Locations.java
@@ -1,128 +1,126 @@
package com.thatgravyboat.skyblockhud.location;
public enum Locations {
-
//ERROR LOCATIONS
- DEFAULT("unknown", "Error", LocationCategory.ERROR),
- NONE("none", "Unknown", LocationCategory.ERROR),
+ DEFAULT("unknown", "Error", LocationCategory.ERROR),
+ NONE("none", "Unknown", LocationCategory.ERROR),
//ISLAND
- YOURISLAND("yourisland", "Your Island", LocationCategory.ISLAND),
- GUESTISLAND("guestisland", "Guest Island", LocationCategory.ISLAND),
- MOULBERRYSISLAND("moulberryisland", "Cool Dude Hub", LocationCategory.ISLAND),
+ YOURISLAND("yourisland", "Your Island", LocationCategory.ISLAND),
+ GUESTISLAND("guestisland", "Guest Island", LocationCategory.ISLAND),
+ MOULBERRYSISLAND("moulberryisland", "Cool Dude Hub", LocationCategory.ISLAND),
//HUB
- VILLAGE("village", "Village", LocationCategory.HUB),
- AUCTIONHOUSE("auctionhouse", "Auction House", LocationCategory.HUB),
- BAZAARALLEY("bazaaralley", "Bazaar Alley", LocationCategory.HUB),
- BANK("bank", "Bank", LocationCategory.HUB),
- FASHIONSHOP("fashionshop", "Fashion Shop", LocationCategory.HUB),
- COLOSSEUM("colosseum", "Colosseum", LocationCategory.HUB),
- COLOSSEUMARENA("colosseumarena", "Colosseum Arena", LocationCategory.HUB),
- MOUNTAIN("mountain", "Mountain", LocationCategory.HUB),
- HIGHLEVEL("highlevel", "High Level", LocationCategory.HUB),
- WILDERNESS("wilderness", "Wilderness", LocationCategory.HUB),
- FISHERMANSHUT("fishermanshut", "Fisherman's Hut", LocationCategory.HUB),
- FLOWERHOUSE("flowerhouse", "Flower House", LocationCategory.HUB),
- CANVASROOM("canvasroom", "Canvas Room", LocationCategory.HUB),
- TAVERN("tavern", "Tavern", LocationCategory.HUB),
- FOREST("forest", "Forest", LocationCategory.HUB),
- RUINS("ruins", "Ruins", LocationCategory.HUB),
- GRAVEYARD("graveyard", "Graveyard", LocationCategory.HUB),
- COALMINE("coalmine", "Coal Mine", LocationCategory.HUB),
- FARM("farm", "Farm", LocationCategory.HUB),
- LIBRARY("library", "Library", LocationCategory.HUB),
- COMMUNITYCENTER("communitycenter", "Community Center", LocationCategory.HUB),
- ELECTIONROOM("electionroom", "Election Room", LocationCategory.HUB),
- BUILDERSHOUSE("buildershouse", "Builder's House", LocationCategory.HUB),
- BLACKSMITH("blacksmith", "Blacksmith", LocationCategory.HUB),
- FARMHOUSE("farmhouse", "Farmhouse", LocationCategory.HUB),
- WIZARDTOWER("wizardtower", "Wizard Tower", LocationCategory.HUB),
+ VILLAGE("village", "Village", LocationCategory.HUB),
+ AUCTIONHOUSE("auctionhouse", "Auction House", LocationCategory.HUB),
+ BAZAARALLEY("bazaaralley", "Bazaar Alley", LocationCategory.HUB),
+ BANK("bank", "Bank", LocationCategory.HUB),
+ FASHIONSHOP("fashionshop", "Fashion Shop", LocationCategory.HUB),
+ COLOSSEUM("colosseum", "Colosseum", LocationCategory.HUB),
+ COLOSSEUMARENA("colosseumarena", "Colosseum Arena", LocationCategory.HUB),
+ MOUNTAIN("mountain", "Mountain", LocationCategory.HUB),
+ HIGHLEVEL("highlevel", "High Level", LocationCategory.HUB),
+ WILDERNESS("wilderness", "Wilderness", LocationCategory.HUB),
+ FISHERMANSHUT("fishermanshut", "Fisherman's Hut", LocationCategory.HUB),
+ FLOWERHOUSE("flowerhouse", "Flower House", LocationCategory.HUB),
+ CANVASROOM("canvasroom", "Canvas Room", LocationCategory.HUB),
+ TAVERN("tavern", "Tavern", LocationCategory.HUB),
+ FOREST("forest", "Forest", LocationCategory.HUB),
+ RUINS("ruins", "Ruins", LocationCategory.HUB),
+ GRAVEYARD("graveyard", "Graveyard", LocationCategory.HUB),
+ COALMINE("coalmine", "Coal Mine", LocationCategory.HUB),
+ FARM("farm", "Farm", LocationCategory.HUB),
+ LIBRARY("library", "Library", LocationCategory.HUB),
+ COMMUNITYCENTER("communitycenter", "Community Center", LocationCategory.HUB),
+ ELECTIONROOM("electionroom", "Election Room", LocationCategory.HUB),
+ BUILDERSHOUSE("buildershouse", "Builder's House", LocationCategory.HUB),
+ BLACKSMITH("blacksmith", "Blacksmith", LocationCategory.HUB),
+ FARMHOUSE("farmhouse", "Farmhouse", LocationCategory.HUB),
+ WIZARDTOWER("wizardtower", "Wizard Tower", LocationCategory.HUB),
//THE BARN
- THEBARN("thebarn", "The Barn", LocationCategory.BARN),
- WINDMILL("windmill", "Windmill", LocationCategory.BARN),
+ THEBARN("thebarn", "The Barn", LocationCategory.BARN),
+ WINDMILL("windmill", "Windmill", LocationCategory.BARN),
//MUSHROOM DESERT
- MUSHROOMDESERT("mushroomdesert", "Mushroom Desert", LocationCategory.MUSHROOMDESERT),
- DESERTSETTLEMENT("desertsettlement", "Desert Settlement", LocationCategory.MUSHROOMDESERT),
- OASIS("oasis", "Oasis", LocationCategory.MUSHROOMDESERT),
- MUSHROOMGORGE("mushroomgorge", "Mushroom Gorge", LocationCategory.MUSHROOMDESERT),
- SHEPHERDSKEEP("shepherdskeep", "Shepherds Keep", LocationCategory.MUSHROOMDESERT),
- JAKESHOUSE("jakeshouse", "Jake's House", LocationCategory.MUSHROOMDESERT),
- TREASUREHUNTERCAMP("treasurehuntercamp", "Treasure Hunter Camp", LocationCategory.MUSHROOMDESERT),
- GLOWINGMUSHROOMCAVE("glowingmushroomcave", "Glowing Mushroom Cave", LocationCategory.MUSHROOMDESERT),
- TRAPPERSDEN("trappersden", "Trappers Den", LocationCategory.MUSHROOMDESERT),
- OVERGROWNMUSHROOMCAVE("overgrownmushroomcave", "Overgrown Mushroom Cave", LocationCategory.MUSHROOMDESERT),
+ MUSHROOMDESERT("mushroomdesert", "Mushroom Desert", LocationCategory.MUSHROOMDESERT),
+ DESERTSETTLEMENT("desertsettlement", "Desert Settlement", LocationCategory.MUSHROOMDESERT),
+ OASIS("oasis", "Oasis", LocationCategory.MUSHROOMDESERT),
+ MUSHROOMGORGE("mushroomgorge", "Mushroom Gorge", LocationCategory.MUSHROOMDESERT),
+ SHEPHERDSKEEP("shepherdskeep", "Shepherds Keep", LocationCategory.MUSHROOMDESERT),
+ JAKESHOUSE("jakeshouse", "Jake's House", LocationCategory.MUSHROOMDESERT),
+ TREASUREHUNTERCAMP("treasurehuntercamp", "Treasure Hunter Camp", LocationCategory.MUSHROOMDESERT),
+ GLOWINGMUSHROOMCAVE("glowingmushroomcave", "Glowing Mushroom Cave", LocationCategory.MUSHROOMDESERT),
+ TRAPPERSDEN("trappersden", "Trappers Den", LocationCategory.MUSHROOMDESERT),
+ OVERGROWNMUSHROOMCAVE("overgrownmushroomcave", "Overgrown Mushroom Cave", LocationCategory.MUSHROOMDESERT),
//GOLD MINE
- GOLDMINE("goldmine", "Gold Mine", LocationCategory.GOLDMINE),
+ GOLDMINE("goldmine", "Gold Mine", LocationCategory.GOLDMINE),
//DEEP CAVERNS
- DEEPCAVERNS("deepcaverns", "Deep Caverns", LocationCategory.DEEPCAVERNS),
- GUNPOWDERMINES("gunpowdermines", "Gunpowder Mines", LocationCategory.DEEPCAVERNS),
- LAPISQUARRY("lapisquarry", "Lapis Quarry", LocationCategory.DEEPCAVERNS),
- PIGMANSDEN("pigmansden", "Pigman's Den", LocationCategory.DEEPCAVERNS),
- SLIMEHILL("slimehill", "Slimehill", LocationCategory.DEEPCAVERNS),
- DIAMONDRESERVE("diamondreserve", "Diamond Reserve", LocationCategory.DEEPCAVERNS),
- OBSIDIANSANCTUARY("obsidiansanctuary", "Obsidian Sanctuary", LocationCategory.DEEPCAVERNS),
+ DEEPCAVERNS("deepcaverns", "Deep Caverns", LocationCategory.DEEPCAVERNS),
+ GUNPOWDERMINES("gunpowdermines", "Gunpowder Mines", LocationCategory.DEEPCAVERNS),
+ LAPISQUARRY("lapisquarry", "Lapis Quarry", LocationCategory.DEEPCAVERNS),
+ PIGMANSDEN("pigmansden", "Pigman's Den", LocationCategory.DEEPCAVERNS),
+ SLIMEHILL("slimehill", "Slimehill", LocationCategory.DEEPCAVERNS),
+ DIAMONDRESERVE("diamondreserve", "Diamond Reserve", LocationCategory.DEEPCAVERNS),
+ OBSIDIANSANCTUARY("obsidiansanctuary", "Obsidian Sanctuary", LocationCategory.DEEPCAVERNS),
//SPIDERS DEN
- SPIDERSDEN("spidersden", "Spider's Den", LocationCategory.SPIDERSDEN),
+ SPIDERSDEN("spidersden", "Spider's Den", LocationCategory.SPIDERSDEN),
//THE END
- THEEND("theend", "The End", LocationCategory.THEEND),
- DRAGONSNEST("dragonsnest", "Dragon's Nest", LocationCategory.THEEND),
- VOIDSEPULTURE("voidsepulture", "Void Sepulture", LocationCategory.THEEND),
+ THEEND("theend", "The End", LocationCategory.THEEND),
+ DRAGONSNEST("dragonsnest", "Dragon's Nest", LocationCategory.THEEND),
+ VOIDSEPULTURE("voidsepulture", "Void Sepulture", LocationCategory.THEEND),
//PARK
- HOWLINGCAVE("howlingcave", "Howling Cave", LocationCategory.PARK),
- BIRCHPARK("birchpark", "Birch Park", LocationCategory.PARK),
- SPRUCEWOODS("sprucewoods", "Spruce Woods", LocationCategory.PARK),
- DARKTHICKET("darkthicket", "Dark Thicket", LocationCategory.PARK),
- SAVANNAWOODLAND("savannawoodland", "Savanna Woodland", LocationCategory.PARK),
- JUNGLEISLAND("jungleisland", "Jungle Island", LocationCategory.PARK),
+ HOWLINGCAVE("howlingcave", "Howling Cave", LocationCategory.PARK),
+ BIRCHPARK("birchpark", "Birch Park", LocationCategory.PARK),
+ SPRUCEWOODS("sprucewoods", "Spruce Woods", LocationCategory.PARK),
+ DARKTHICKET("darkthicket", "Dark Thicket", LocationCategory.PARK),
+ SAVANNAWOODLAND("savannawoodland", "Savanna Woodland", LocationCategory.PARK),
+ JUNGLEISLAND("jungleisland", "Jungle Island", LocationCategory.PARK),
//BLAZING FORTRESS
- BLAZINGFORTRESS("blazingfortress", "Blazing Fortress", LocationCategory.FORTRESS),
+ BLAZINGFORTRESS("blazingfortress", "Blazing Fortress", LocationCategory.FORTRESS),
//DUNGEONS
- DUNGEONHUB("dungeonhub", "Dungeon Hub", LocationCategory.DUNGEONHUB),
- CATACOMBS("catacombs", "The Catacombs", LocationCategory.DUNGEONHUB),
- CATACOMBSENTRANCE("catacombsentrance", "Catacombs Entrance", LocationCategory.DUNGEONHUB),
+ DUNGEONHUB("dungeonhub", "Dungeon Hub", LocationCategory.DUNGEONHUB),
+ CATACOMBS("catacombs", "The Catacombs", LocationCategory.DUNGEONHUB),
+ CATACOMBSENTRANCE("catacombsentrance", "Catacombs Entrance", LocationCategory.DUNGEONHUB),
//JERRYISLAND
- JERRYSWORKSHOP("jerrysworkshop", "Jerry's Workshop", LocationCategory.JERRY),
- JERRYPOND("jerrypond", "Jerry Pond", LocationCategory.JERRY),
+ JERRYSWORKSHOP("jerrysworkshop", "Jerry's Workshop", LocationCategory.JERRY),
+ JERRYPOND("jerrypond", "Jerry Pond", LocationCategory.JERRY),
//DWARVENMINES
- THELIFT("thelift", "The Lift", LocationCategory.DWARVENMINES),
- DWARVENVILLAGE("dwarvenvillage", "Dwarven Village", LocationCategory.DWARVENMINES),
- DWARVENMINES("dwarvenmines", "Dwarven Mines", LocationCategory.DWARVENMINES),
- LAVASPRINGS("lavasprings", "Lava Springs", LocationCategory.DWARVENMINES),
- PALACEBRIDGE("palacebridge", "Palace Bridge", LocationCategory.DWARVENMINES),
- ROYALPALACE("royalpalace", "Royal Palace", LocationCategory.DWARVENMINES),
- GRANDLIBRARY("grandlibrary", "Grand Library", LocationCategory.DWARVENMINES),
- ROYALQUARTERS("royalquarters", "Royal Quarters", LocationCategory.DWARVENMINES),
- BARRACKSOFHEROES("barracksofheroes", "Barracks of Heroes", LocationCategory.DWARVENMINES),
- HANGINGCOURT("hangingcourt", "Hanging Court", LocationCategory.DWARVENMINES),
- GREATICEWALL("greaticewall", "Great Ice Wall", LocationCategory.DWARVENMINES),
- GOBLINBURROWS("goblinburrows", "Goblin Burrows", LocationCategory.DWARVENMINES),
- FARRESERVE("farreserve", "Far Reserve", LocationCategory.DWARVENMINES),
- CCMINECARTSCO("ccminecartco", "Minecart Co.", LocationCategory.DWARVENMINES),
- UPPERMINES("uppermines", "Upper Mines", LocationCategory.DWARVENMINES),
- RAMPARTSQUARRY("rampartsquarry", "Ramparts Quarry", LocationCategory.DWARVENMINES),
- GATESTOTHEMINES("gatestothemines", "Gates to The Mines", LocationCategory.DWARVENMINES),
- FORGEBASIN("forgebasin", "Forge Basin", LocationCategory.DWARVENMINES),
- THEFORGE("theforge", "The Forge", LocationCategory.DWARVENMINES),
- CLIFFSIDEVEINS("cliffsideveins", "Cliffside Veins", LocationCategory.DWARVENMINES),
- DIVANSGATEWAY("divansgateway", "Divan's Gateway", LocationCategory.DWARVENMINES),
- THEMIST("themist", "The Mist", LocationCategory.DWARVENMINES),
- ROYALMINES("royalmines", "Royal Mines", LocationCategory.DWARVENMINES),
- ARISTOCRATPASSAGE("aristocratpassage", "Aristocrat Passage", LocationCategory.DWARVENMINES),
- MINERSGUILD("minersguild", "Miner's Guild", LocationCategory.DWARVENMINES),
+ THELIFT("thelift", "The Lift", LocationCategory.DWARVENMINES),
+ DWARVENVILLAGE("dwarvenvillage", "Dwarven Village", LocationCategory.DWARVENMINES),
+ DWARVENMINES("dwarvenmines", "Dwarven Mines", LocationCategory.DWARVENMINES),
+ LAVASPRINGS("lavasprings", "Lava Springs", LocationCategory.DWARVENMINES),
+ PALACEBRIDGE("palacebridge", "Palace Bridge", LocationCategory.DWARVENMINES),
+ ROYALPALACE("royalpalace", "Royal Palace", LocationCategory.DWARVENMINES),
+ GRANDLIBRARY("grandlibrary", "Grand Library", LocationCategory.DWARVENMINES),
+ ROYALQUARTERS("royalquarters", "Royal Quarters", LocationCategory.DWARVENMINES),
+ BARRACKSOFHEROES("barracksofheroes", "Barracks of Heroes", LocationCategory.DWARVENMINES),
+ HANGINGCOURT("hangingcourt", "Hanging Court", LocationCategory.DWARVENMINES),
+ GREATICEWALL("greaticewall", "Great Ice Wall", LocationCategory.DWARVENMINES),
+ GOBLINBURROWS("goblinburrows", "Goblin Burrows", LocationCategory.DWARVENMINES),
+ FARRESERVE("farreserve", "Far Reserve", LocationCategory.DWARVENMINES),
+ CCMINECARTSCO("ccminecartco", "Minecart Co.", LocationCategory.DWARVENMINES),
+ UPPERMINES("uppermines", "Upper Mines", LocationCategory.DWARVENMINES),
+ RAMPARTSQUARRY("rampartsquarry", "Ramparts Quarry", LocationCategory.DWARVENMINES),
+ GATESTOTHEMINES("gatestothemines", "Gates to The Mines", LocationCategory.DWARVENMINES),
+ FORGEBASIN("forgebasin", "Forge Basin", LocationCategory.DWARVENMINES),
+ THEFORGE("theforge", "The Forge", LocationCategory.DWARVENMINES),
+ CLIFFSIDEVEINS("cliffsideveins", "Cliffside Veins", LocationCategory.DWARVENMINES),
+ DIVANSGATEWAY("divansgateway", "Divan's Gateway", LocationCategory.DWARVENMINES),
+ THEMIST("themist", "The Mist", LocationCategory.DWARVENMINES),
+ ROYALMINES("royalmines", "Royal Mines", LocationCategory.DWARVENMINES),
+ ARISTOCRATPASSAGE("aristocratpassage", "Aristocrat Passage", LocationCategory.DWARVENMINES),
+ MINERSGUILD("minersguild", "Miner's Guild", LocationCategory.DWARVENMINES),
//CRYSTALHOLLOWS
- JUNGLE("jungle", "Jungle", LocationCategory.CRYSTALHOLLOWS),
- MAMGAFIELDS("magmafields", "Magma Fields", LocationCategory.CRYSTALHOLLOWS),
- GOBLINHOLDOUT("goblinholdout", "Goblin Holdout", LocationCategory.CRYSTALHOLLOWS),
- CRYSTALNUCLEUS("crystalnucleus", "Crystal Nucleus", LocationCategory.CRYSTALHOLLOWS),
- PERCURSORREMNANTS("precursorremnants", "Precursor Remnants", LocationCategory.CRYSTALHOLLOWS),
- MITHRILDEPOSITS("mithrildeposits", "Mithril Deposits", LocationCategory.CRYSTALHOLLOWS);
-
+ JUNGLE("jungle", "Jungle", LocationCategory.CRYSTALHOLLOWS),
+ MAMGAFIELDS("magmafields", "Magma Fields", LocationCategory.CRYSTALHOLLOWS),
+ GOBLINHOLDOUT("goblinholdout", "Goblin Holdout", LocationCategory.CRYSTALHOLLOWS),
+ CRYSTALNUCLEUS("crystalnucleus", "Crystal Nucleus", LocationCategory.CRYSTALHOLLOWS),
+ PERCURSORREMNANTS("precursorremnants", "Precursor Remnants", LocationCategory.CRYSTALHOLLOWS),
+ MITHRILDEPOSITS("mithrildeposits", "Mithril Deposits", LocationCategory.CRYSTALHOLLOWS);
private final String name;
private final String displayName;
private final LocationCategory category;
- Locations(String name, String displayName, LocationCategory category){
+ Locations(String name, String displayName, LocationCategory category) {
this.name = name;
this.displayName = displayName;
this.category = category;
@@ -140,7 +138,7 @@ public enum Locations {
return this.category;
}
- static public Locations get(String id) {
+ public static Locations get(String id) {
try {
return Locations.valueOf(id.replace(" ", "").toUpperCase());
} catch (IllegalArgumentException ex) {
@@ -149,7 +147,6 @@ public enum Locations {
}
}
-
@Override
public String toString() {
return this.name;
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java
index 2a41391..b9628d0 100644
--- a/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/ParkIslandHandler.java
@@ -7,25 +7,23 @@ public class ParkIslandHandler {
private static boolean isRaining = false;
private static String rainTime = "";
- public static void parseRain(@Nullable String tabLine){
- if (tabLine == null){
+ public static void parseRain(@Nullable String tabLine) {
+ if (tabLine == null) {
isRaining = false;
rainTime = "";
- }
- else if (tabLine.toLowerCase().contains("rain:")){
- if (tabLine.toLowerCase().contains("no rain")) isRaining = false;
- else {
+ } else if (tabLine.toLowerCase().contains("rain:")) {
+ if (tabLine.toLowerCase().contains("no rain")) isRaining = false; else {
rainTime = tabLine.toLowerCase().replace("rain:", "").replace(" ", "");
isRaining = true;
}
}
}
- public static String getRainTime(){
+ public static String getRainTime() {
return rainTime;
}
- public static boolean isRaining(){
+ public static boolean isRaining() {
return isRaining;
}
}