Remove Protocol1_9To1_8#FIX_JSON usage in 1.11->1.12 (#3791)

This commit is contained in:
EnZaXD 2024-04-18 15:26:13 +02:00 committed by GitHub
parent 98c5d38d0c
commit 4302dd61aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -100,11 +100,11 @@ public class Protocol1_12To1_11_1 extends AbstractProtocol<ClientboundPackets1_9
registerClientbound(ClientboundPackets1_9_3.CHAT_MESSAGE, wrapper -> {
if (!Via.getConfig().is1_12NBTArrayFix()) return;
try {
JsonElement obj = Protocol1_9To1_8.FIX_JSON.transform(null, wrapper.passthrough(Type.COMPONENT).toString());
TranslateRewriter.toClient(obj);
ChatItemRewriter.toClient(obj);
final JsonElement element = wrapper.passthrough(Type.COMPONENT);
TranslateRewriter.toClient(element);
ChatItemRewriter.toClient(element);
wrapper.set(Type.COMPONENT, 0, obj);
wrapper.set(Type.COMPONENT, 0, element);
} catch (Exception e) {
Via.getPlatform().getLogger().log(Level.WARNING, "Error converting 1.11.2 -> 1.12 chat item", e);
}