From 5736af8495977b35af1d48dc8314cb45629a6ebc Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 17 Feb 2023 20:29:37 +0100 Subject: Make cleanup percentage work without updating --- .../com/thatgravyboat/skyblockhud/location/IslandHandler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java index a2d113d..5641202 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/IslandHandler.java @@ -3,6 +3,7 @@ package com.thatgravyboat.skyblockhud.location; import com.thatgravyboat.skyblockhud.api.events.LocationChangeEvent; 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.utils.Utils; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -26,6 +27,13 @@ public class IslandHandler { hadCleanupPercentage |= checkPlotClearPercentage(event.formattedLine); } + @SubscribeEvent + public void onSidebarUpdate(SidebarPostEvent event) { + for (String line : event.scores) { + hadCleanupPercentage |= checkPlotClearPercentage(line.replaceAll("[^a-zA-Z:0-9,%. ]", "")); + } + } + @SubscribeEvent public void onLocationChange(LocationChangeEvent event) { hadCleanupPercentage = false; -- cgit