Fix color not being displayed after a forward slash

This commit is contained in:
themode 2021-02-02 06:56:45 +01:00
parent 7843f74b4b
commit f17a518e92

View File

@ -178,7 +178,7 @@ public class ColoredText extends JsonMessage {
final Character p = i == 0 ? null : message.charAt(i - 1); final Character p = i == 0 ? null : message.charAt(i - 1);
// Current char // Current char
final char c = message.charAt(i); final char c = message.charAt(i);
if ((p == null || (p != '/')) && c == '{' && !inFormat) { if (c == '{' && !inFormat) {
formatEnd = formatEnd > 0 ? formatEnd + 1 : formatEnd; formatEnd = formatEnd > 0 ? formatEnd + 1 : formatEnd;
final String rawMessage = message.substring(formatEnd, i); final String rawMessage = message.substring(formatEnd, i);
@ -189,7 +189,7 @@ public class ColoredText extends JsonMessage {
inFormat = true; inFormat = true;
formatStart = i; formatStart = i;
continue; continue;
} else if ((p == null || (p != '/')) && c == '}' && inFormat) { } else if (c == '}' && inFormat) {
// Represent the custom format between the brackets // Represent the custom format between the brackets
final String formatString = message.substring(formatStart + 1, i); final String formatString = message.substring(formatStart + 1, i);
if (formatString.isEmpty()) if (formatString.isEmpty())