diff options
author | DoKM <mcazzyman@gmail.com> | 2021-09-14 22:37:02 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-09-14 22:37:02 +0200 |
commit | df79de1b28b31421a205624098d60bd07c358b51 (patch) | |
tree | ede78d985b28cfd7dce0e85dd1924d932ac9e822 /src/main/java/io | |
parent | 8f7dd510c4245deae31c301660f6b55edab32ac3 (diff) | |
download | NotEnoughUpdates-df79de1b28b31421a205624098d60bd07c358b51.tar.gz NotEnoughUpdates-df79de1b28b31421a205624098d60bd07c358b51.tar.bz2 NotEnoughUpdates-df79de1b28b31421a205624098d60bd07c358b51.zip |
Fix hypixel breaking custom enchant colours and add counter enchant support
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index d2603651..716c62c1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -2073,7 +2073,7 @@ public class NEUEventListener { Pattern pattern; try { pattern = Pattern.compile("(\\u00A79|\\u00A79\\u00A7d\\u00A7l)("+enchantName+") " + - "([0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX))(,|$)"); + "(?<level>[0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X|XI|XII|XIII|XIV|XV|XVI|XVII|XVIII|XIX|XX))((\\u00A79)?,|( \\u00A78(?:,?[0-9]+)*)?$)"); } catch(Exception e) {continue;} //malformed regex Matcher matcher = pattern.matcher(line); int matchCount = 0; @@ -2082,7 +2082,7 @@ public class NEUEventListener { matchCount++; int level = -1; - String levelStr = matcher.group(matcher.groupCount()-2); + String levelStr = matcher.group("level"); if(levelStr == null) continue; try { level = Integer.parseInt(levelStr); |