aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/location
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-13 01:51:19 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-07-13 01:51:19 -0230
commit3bd212839e1d3c497a840221a0c149451967467e (patch)
tree9a306491b76808a17a26c6bef6f74c08cbc99964 /src/main/java/com/thatgravyboat/skyblockhud/location
parent087d97fb0663edc5e343187c0fa4ec1bc6b081bc (diff)
downloadSkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.tar.gz
SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.tar.bz2
SkyblockHud-Death-Defied-3bd212839e1d3c497a840221a0c149451967467e.zip
Added 2 new subcommands to crystal waypoints, Added medals shown in farmhouse, Added config option to stop auto flipping of rpg hud, Added option so if exp bar is still being rendered it should hide when holding drill to not overlay them and keep a consistent hud
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/location')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java
new file mode 100644
index 0000000..432bfbb
--- /dev/null
+++ b/src/main/java/com/thatgravyboat/skyblockhud/location/FarmHouseHandler.java
@@ -0,0 +1,42 @@
+package com.thatgravyboat.skyblockhud.location;
+
+import com.thatgravyboat.skyblockhud.api.events.ProfileSwitchedEvent;
+import com.thatgravyboat.skyblockhud.api.events.SidebarLineUpdateEvent;
+import java.util.Arrays;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+
+public class FarmHouseHandler {
+
+ public enum Medal {
+ BRONZE,
+ SILVER,
+ GOLD
+ }
+
+ private static final int[] medals = new int[Medal.values().length];
+
+ @SubscribeEvent
+ public void onSidebarLineUpdate(SidebarLineUpdateEvent event) {
+ if (event.formattedLine.contains("medals:")){
+ for (Medal value : Medal.values()) {
+ if (event.formattedLine.contains(value.name())){
+ try {
+ medals[value.ordinal()] = Integer.parseInt(event.formattedLine.replace("medals:", "").replace(value.name(), "").trim());
+ }catch (Exception ignored){}
+ break;
+ }
+ }
+ }
+ }
+
+ @SubscribeEvent
+ public void onProfileSwitch(ProfileSwitchedEvent event){
+ Arrays.fill(medals, 0);
+ }
+
+ public static String getFormattedMedals(Medal medal){
+ if (medal == null) return "0";
+ return String.valueOf(medals[medal.ordinal()]);
+ }
+
+}