diff options
author | DoKM <mcazzyman@gmail.com> | 2021-07-30 13:15:31 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-07-30 13:15:31 +0200 |
commit | e32e28313e78c074c52ec125eadd5597b8337e85 (patch) | |
tree | 42c76a1c0e7944d3359c491fb76fdf5184f9dde1 /src/main/java/io | |
parent | 41502159b073a736c598b6dcfd631342f319a508 (diff) | |
download | NotEnoughUpdates-e32e28313e78c074c52ec125eadd5597b8337e85.tar.gz NotEnoughUpdates-e32e28313e78c074c52ec125eadd5597b8337e85.tar.bz2 NotEnoughUpdates-e32e28313e78c074c52ec125eadd5597b8337e85.zip |
Fix dungeon win overlay
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java index ab4d1b7b..95ca32c9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonWin.java @@ -139,18 +139,23 @@ public class DungeonWin { } } + public static void onChatMessage(ClientChatReceivedEvent e) { if(e.type == 2) return; if(NotEnoughUpdates.INSTANCE.config.dungeons.dungeonWinMillis < 100 || !NotEnoughUpdates.INSTANCE.config.dungeons.enableDungeonWin) return; + long currentTime = System.currentTimeMillis(); String unformatted = Utils.cleanColour(e.message.getUnformattedText()); - if(e.message.getFormattedText().startsWith(EnumChatFormatting.RESET+" ")) { + + //Added two more Resets, cant do Reset+Reset+Reset cause idk? + //hypixel please dont randomly add more + + if(e.message.getFormattedText().startsWith(EnumChatFormatting.RESET+""+EnumChatFormatting.RESET+""+EnumChatFormatting.RESET+" ")){ if(currentTime - lastDungeonFinish > 30000) { Matcher matcher = TEAM_SCORE_REGEX.matcher(unformatted); if(matcher.find()) { lastDungeonFinish = currentTime; - String score = matcher.group(1); switch (score.toUpperCase()) { case "S+": @@ -183,7 +188,7 @@ public class DungeonWin { displayWin(); } else { if(unformatted.trim().length() > 0) { - text.add(e.message.getFormattedText().substring(2).trim()); + text.add(e.message.getFormattedText().substring(6).trim()); } } } else { |