From 72adbc192fc53cd90408f4382b66310d77e2be2a Mon Sep 17 00:00:00 2001 From: KingsMMA <63374258+KingsMMA@users.noreply.github.com> Date: Sat, 22 Oct 2022 00:31:07 +1000 Subject: Added Powder Grinding Tracker (#263) --- .../github/moulberry/notenoughupdates/util/SBInfo.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index d78a6988..095dde87 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -24,6 +24,7 @@ import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeListener; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; +import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; @@ -302,15 +303,21 @@ public class SBInfo { lastLocRaw = System.currentTimeMillis(); NotEnoughUpdates.INSTANCE.sendChatMessage("/locraw"); } - if (currentTime - lastMayorUpdate > 300 * 1000) { - updateMayor(); - lastMayorUpdate = currentTime; - } + if (currentTime - lastMayorUpdate > 300 * 1000) { + updateMayor(); + lastMayorUpdate = currentTime; + } try { for (NetworkPlayerInfo info : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { String name = Minecraft.getMinecraft().ingameGUI.getTabList().getPlayerName(info); if (name.startsWith(profilePrefix)) { - currentProfile = Utils.cleanColour(name.substring(profilePrefix.length())); + String newProfile = Utils.cleanColour(name.substring(profilePrefix.length())); + if (!Objects.equals(currentProfile, newProfile)) { + currentProfile = newProfile; + if (NotEnoughUpdates.INSTANCE.config != null) + if (NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerResetMode == 2) + OverlayManager.powderGrindingOverlay.load(); + } hasNewTab = true; } else if (name.startsWith(skillsPrefix)) { String levelInfo = name.substring(skillsPrefix.length()).trim(); -- cgit