From 8519ad8cf15d27bea2580bbf70e7ed8f3afdc84c Mon Sep 17 00:00:00 2001 From: Gerrygames Date: Tue, 22 Jan 2019 21:41:49 +0100 Subject: [PATCH] fix actionbar color --- .../protocol1_10to1_11/packets/PlayerPackets1_11.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java index 8450fd9e..bde99336 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_10to1_11/packets/PlayerPackets1_11.java @@ -17,6 +17,7 @@ import us.myles.ViaVersion.api.remapper.PacketRemapper; import us.myles.ViaVersion.api.remapper.ValueTransformer; import us.myles.ViaVersion.api.type.Type; import us.myles.ViaVersion.packets.State; +import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.ChatRewriter; public class PlayerPackets1_11 { private static final ValueTransformer toNewFloat = new ValueTransformer(Type.FLOAT) { @@ -44,7 +45,10 @@ public class PlayerPackets1_11 { if (action == 2) { // Convert to the old actionbar way PacketWrapper actionbar = new PacketWrapper(0x0F, null, wrapper.user()); // Chat Message packet - actionbar.write(Type.STRING, wrapper.read(Type.STRING)); + String msg = wrapper.read(Type.STRING); + msg = ChatRewriter.jsonTextToLegacy(msg); + msg = "{\"text\":\"" + msg + "\"}"; + actionbar.write(Type.STRING, msg); actionbar.write(Type.BYTE, (byte) 2); // Above hotbar actionbar.send(Protocol1_10To1_11.class);