diff options
| author | Moulberry <jjenour@student.unimelb.edu.au> | 2021-09-02 14:09:31 +0930 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-02 14:09:31 +0930 |
| commit | 81eea6bf1f653fa194735d892b40614389975dd3 (patch) | |
| tree | a955e0d03401302332c743f6c396184e45c94c80 /src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | |
| parent | 05428d1ccb15f58ccbdb4b14eb9e10b61b0477cc (diff) | |
| parent | 05d6207281e18980b8a28046621c741fa81c1606 (diff) | |
| download | notenoughupdates-81eea6bf1f653fa194735d892b40614389975dd3.tar.gz notenoughupdates-81eea6bf1f653fa194735d892b40614389975dd3.tar.bz2 notenoughupdates-81eea6bf1f653fa194735d892b40614389975dd3.zip | |
Merge pull request #226 from DoKM/master
Pre31 update
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java')
| -rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java | 17 |
1 files changed, 13 insertions, 4 deletions
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..e41ef78d 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(); @@ -191,7 +194,13 @@ public class SBInfo { currentTimeDate = parseFormat.parse(timeSpace); } catch (ParseException e) {} } - location = Utils.cleanColour(lines.get(3)).replaceAll("[^A-Za-z0-9() ]", "").trim(); + //Replaced with for loop because in crystal hollows with events the line it's on can shift. + for (String line : lines){ + if (line.contains("⏣")) { + location = Utils.cleanColour(line).replaceAll("[^A-Za-z0-9() ]", "").trim(); + break; + } + } } objective = null; |
