3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-04 23:30:24 +01:00

Put prefix last color into the start of suffix

Dieser Commit ist enthalten in:
creeper123123321 2018-07-30 08:49:32 -03:00
Ursprung c9dab5402e
Commit d8885f9156
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 0AC57D54786721D1

Datei anzeigen

@ -415,7 +415,8 @@ public class Protocol1_13To1_12_2 extends Protocol {
} }
if (Via.getConfig().is1_13TeamColourFix()) { if (Via.getConfig().is1_13TeamColourFix()) {
colour = getLastColor(prefix); colour = getLastColor(prefix).ordinal();
suffix = getLastColor(prefix).toString() + suffix;
} }
wrapper.write(Type.VAR_INT, colour); wrapper.write(Type.VAR_INT, colour);
@ -844,7 +845,7 @@ public class Protocol1_13To1_12_2 extends Protocol {
} }
// Based on method from https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/ChatColor.java // Based on method from https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/ChatColor.java
public int getLastColor(String input) { public ChatColor getLastColor(String input) {
int length = input.length(); int length = input.length();
for (int index = length - 1; index > -1; index--) { for (int index = length - 1; index > -1; index--) {
@ -863,12 +864,12 @@ public class Protocol1_13To1_12_2 extends Protocol {
case RESET: case RESET:
break; break;
default: default:
return color.ordinal(); return color;
} }
} }
} }
} }
return ChatColor.RESET.ordinal(); return ChatColor.RESET;
} }
} }