3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-19 14:30:16 +01:00

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

Dieser Commit ist enthalten in:
EnZaXD 2024-04-18 15:26:13 +02:00 committet von GitHub
Ursprung 98c5d38d0c
Commit 4302dd61aa
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

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