From 54749d3855cfa5202e5d15363b44c7f4f121c4cf Mon Sep 17 00:00:00 2001 From: DoKM Date: Sun, 19 Sep 2021 23:05:05 +0200 Subject: Change neu's crit commas to represent hypixel's crits --- .../moulberry/notenoughupdates/miscfeatures/DamageCommas.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java index a73320fc..aafcfb4d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java @@ -18,7 +18,7 @@ public class DamageCommas { private static final WeakHashMap replacementMap = new WeakHashMap<>(); - private static final EnumChatFormatting[] colours = {EnumChatFormatting.RED, EnumChatFormatting.GOLD, EnumChatFormatting.YELLOW, EnumChatFormatting.WHITE}; + private static final EnumChatFormatting[] coloursHypixel = {EnumChatFormatting.WHITE, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD, EnumChatFormatting.RED, EnumChatFormatting.RED, EnumChatFormatting.WHITE}; private static final char STAR = '\u2727'; private static final Pattern PATTERN_CRIT = Pattern.compile("\u00a7f"+STAR+"((?:\u00a7.\\d)+)\u00a7."+STAR+"(.*)"); @@ -81,7 +81,11 @@ public class DamageCommas { int colourIndex = 0; for(char c : newFormatted.toString().toCharArray()) { - newFormattedCrit.append(colours[colourIndex++ % colours.length]); + if(c == ',') { + newFormattedCrit.append(EnumChatFormatting.GRAY); + } else { + newFormattedCrit.append(coloursHypixel[colourIndex++ % coloursHypixel.length]); + } newFormattedCrit.append(c); } -- cgit