diff options
author | msg-programs <msgdoesstuff@gmail.com> | 2023-04-23 12:21:34 +0200 |
---|---|---|
committer | msg-programs <msgdoesstuff@gmail.com> | 2023-04-23 12:21:34 +0200 |
commit | 54935e6e6e17f9f7ca54b3bef53b24f65278e86d (patch) | |
tree | 64fde798b3d52361bef692e2d205b8a02327ffa2 /src/main/java/me/xmrvizzy/skyblocker/skyblock | |
parent | 3dca9f4c0a0617969c2d0d0f46b66957a7923dd4 (diff) | |
download | Skyblocker-54935e6e6e17f9f7ca54b3bef53b24f65278e86d.tar.gz Skyblocker-54935e6e6e17f9f7ca54b3bef53b24f65278e86d.tar.bz2 Skyblocker-54935e6e6e17f9f7ca54b3bef53b24f65278e86d.zip |
Dungeon puzzle widget now works as intended.
Diffstat (limited to 'src/main/java/me/xmrvizzy/skyblocker/skyblock')
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/StrMan.java | 4 | ||||
-rw-r--r-- | src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/StrMan.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/StrMan.java index 8cd77ac2..4a30cf0f 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/StrMan.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/util/StrMan.java @@ -44,6 +44,10 @@ public class StrMan { return null; } String str = txt.getString(); + if (str.length() == 0) { + return null; + } + Matcher m = p.matcher(str); if (!m.matches()) { LOGGER.error("ERROR: Regex {} failed for input \"{}\"", p.pattern(), str); diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java index 906d449b..3aba547c 100644 --- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java +++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/tabhud/widget/DungeonPuzzleWidget.java @@ -24,9 +24,9 @@ public class DungeonPuzzleWidget extends Widget { // match a puzzle entry // group 1: name // group 2: status - // yes, that " ?" is needed. + // " ?.*" to diescard the solver's name if present // the teleport maze has a trailing whitespace that messes with the regex - private static final Pattern PUZZLE_PATTERN = Pattern.compile(" (.*): \\[(.*)\\] ?"); + private static final Pattern PUZZLE_PATTERN = Pattern.compile(" (.*): \\[(.*)\\] ?.*"); public DungeonPuzzleWidget(List<PlayerListEntry> list) { super(TITLE, Formatting.DARK_PURPLE.getColorValue()); @@ -43,6 +43,9 @@ public class DungeonPuzzleWidget extends Widget { IcoTextComponent itc = new IcoTextComponent(Ico.SIGN, t); this.addComponent(itc); pos++; + // code points for puzzle status chars unsolved and solved: 10022, 10004 + // not sure which one is which + // still need to find out codepoint for the puzzle failed char } this.pack(); |