From 09b230ab11159e6e367e0f7145040baf49199410 Mon Sep 17 00:00:00 2001 From: DoKM Date: Sun, 1 Aug 2021 19:38:05 +0200 Subject: Hopefully fix slotlocking in dungeons Cant confirm due to the nature of this bug, but with a larger amount of testers this can be confirmed --- .../java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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 1a5e168d..243ee151 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -125,7 +125,7 @@ public class SBInfo { private static final Pattern SKILL_LEVEL_PATTERN = Pattern.compile("([^0-9:]+) (\\d{1,2})"); public void tick() { - isInDungeon = false; + Boolean tempIsInDungeon = false; long currentTime = System.currentTimeMillis(); @@ -171,13 +171,16 @@ public class SBInfo { ScorePlayerTeam scoreplayerteam1 = scoreboard.getPlayersTeam(score.getPlayerName()); String line = ScorePlayerTeam.formatPlayerName(scoreplayerteam1, score.getPlayerName()); line = Utils.cleanDuplicateColourCodes(line); + + String cleanLine = Utils.cleanColour(line); - if(Utils.cleanColour(line).contains("Dungeon Cleared: ")) { - isInDungeon = true; + if(cleanLine.contains("Dungeon") && cleanLine.contains("Cleared:") && cleanLine.contains("%")) { + tempIsInDungeon = true; } lines.add(line); } + isInDungeon= tempIsInDungeon; if(lines.size() >= 5) { date = Utils.cleanColour(lines.get(1)).trim(); -- cgit