From d8885f9156b4ef33f5f53e30cc7c8f6ae060a9e9 Mon Sep 17 00:00:00 2001 From: creeper123123321 Date: Mon, 30 Jul 2018 08:49:32 -0300 Subject: [PATCH] Put prefix last color into the start of suffix --- .../protocol1_13to1_12_2/Protocol1_13To1_12_2.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java index 448d277d9..ede670f54 100644 --- a/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java +++ b/common/src/main/java/us/myles/ViaVersion/protocols/protocol1_13to1_12_2/Protocol1_13To1_12_2.java @@ -415,7 +415,8 @@ public class Protocol1_13To1_12_2 extends Protocol { } if (Via.getConfig().is1_13TeamColourFix()) { - colour = getLastColor(prefix); + colour = getLastColor(prefix).ordinal(); + suffix = getLastColor(prefix).toString() + suffix; } 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 - public int getLastColor(String input) { + public ChatColor getLastColor(String input) { int length = input.length(); for (int index = length - 1; index > -1; index--) { @@ -863,12 +864,12 @@ public class Protocol1_13To1_12_2 extends Protocol { case RESET: break; default: - return color.ordinal(); + return color; } } } } - return ChatColor.RESET.ordinal(); + return ChatColor.RESET; } }