Fix version blocking on 1.8

Fixes #2142
This commit is contained in:
KennyTV 2020-10-16 18:26:15 +02:00
parent 7d96efc645
commit edd71bf8ab
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -101,7 +101,14 @@ public class Protocol1_9To1_8 extends Protocol<ClientboundPackets1_8, Clientboun
registerOutgoing(State.LOGIN, 0x00, 0x00, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.STRING, Protocol1_9To1_8.FIX_JSON); // 0 - Reason
handler(wrapper -> {
if (wrapper.isReadable(Type.COMPONENT, 0)) {
// Already written as json somewhere else
return;
}
wrapper.write(Type.COMPONENT, fixJson(wrapper.read(Type.STRING)));
});
}
});