From fa5dc11db897da6689ab1d8edbe7a26e03425dfd Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 11 Apr 2024 11:46:49 +0200 Subject: Fix dwarven overlay showing too often --- .../notenoughupdates/overlays/MiningOverlay.java | 29 ++++++++++++++-------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index 39f7b716..818f626e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -28,6 +28,7 @@ import io.github.moulberry.notenoughupdates.guifeatures.SkyMallDisplay; import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns; import io.github.moulberry.notenoughupdates.miscfeatures.tablisttutorial.TablistAPI; import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.options.separatesections.Mining; import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.StarCultCalculator; @@ -172,7 +173,7 @@ public class MiningOverlay extends TextTabOverlay { if (line == null) { continue; } - if(!line.contains("▶"))continue; + if (!line.contains("▶")) continue; String cleanLine = Utils.cleanColour(line).replace("▶", "").trim(); if (cleanLine.equals("Dwarven Mines")) { commLocation = "mining_3"; @@ -265,7 +266,8 @@ public class MiningOverlay extends TextTabOverlay { if (!NotEnoughUpdates.INSTANCE.config.mining.dwarvenOverlay && NotEnoughUpdates.INSTANCE.config.mining.emissaryWaypoints == 0 && !NotEnoughUpdates.INSTANCE.config.mining.titaniumAlert && - NotEnoughUpdates.INSTANCE.config.mining.locWaypoints == 0) { + NotEnoughUpdates.INSTANCE.config.mining.locWaypoints == 0 + && NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints != Mining.GlaciteTunnelWaypointBehaviour.NONE) { return; } @@ -273,8 +275,8 @@ public class MiningOverlay extends TextTabOverlay { //thanks to "Pure Genie#7250" for helping with this (makes tita alert and waypoints work without mine overlay) if (SBInfo.getInstance().getLocation() == null) return; if (SBInfo.getInstance().getLocation().equals("mining_3") || - SBInfo.getInstance().getLocation().equals("crystal_hollows") || SBInfo.getInstance().getLocation().equals( - "mineshaft")) { + SBInfo.getInstance().getLocation().equals("crystal_hollows") + || SBInfo.getInstance().getLocation().equals("mineshaft")) { commissionProgress.clear(); // These strings will be displayed one after the other when the player list is disabled @@ -395,6 +397,18 @@ public class MiningOverlay extends TextTabOverlay { } } + if (ItemCooldowns.firstLoadMillis > 0) { + //set cooldown on first skyblock load. + ItemCooldowns.pickaxeUseCooldownMillisRemaining = + 60 * 1000 - (System.currentTimeMillis() - ItemCooldowns.firstLoadMillis); + ItemCooldowns.firstLoadMillis = 0; + } + + if (!NotEnoughUpdates.INSTANCE.config.mining.dwarvenOverlay) { + overlayStrings = null; + return; + } + List commissionsStrings = new ArrayList<>(); for (Map.Entry entry : commissionProgress.entrySet()) { if (entry.getValue() >= 1) { @@ -433,13 +447,6 @@ public class MiningOverlay extends TextTabOverlay { } } - if (ItemCooldowns.firstLoadMillis > 0) { - //set cooldown on first skyblock load. - ItemCooldowns.pickaxeUseCooldownMillisRemaining = - 60 * 1000 - (System.currentTimeMillis() - ItemCooldowns.firstLoadMillis); - ItemCooldowns.firstLoadMillis = 0; - } - String pickaxeCooldown; if (ItemCooldowns.pickaxeUseCooldownMillisRemaining <= 0) { pickaxeCooldown = DARK_AQUA + "Pickaxe CD: \u00a7aReady"; -- cgit