diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_1to1_19/Protocol1_19_1To1_19.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_1to1_19/Protocol1_19_1To1_19.java index 8a5925e83..b8b9b4705 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_1to1_19/Protocol1_19_1To1_19.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_19_1to1_19/Protocol1_19_1To1_19.java @@ -94,14 +94,14 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol { - // Back to system chat - final JsonElement signedContnet = wrapper.read(Type.COMPONENT); + // Back to system chat - bye bye chat formats for 1.19.0 players + // ... not that big of a deal since the majority of modded servers only has Vanilla /say command and the alike sent as proper player chat + final JsonElement signedContent = wrapper.read(Type.COMPONENT); final JsonElement unsignedContent = wrapper.read(Type.OPTIONAL_COMPONENT); - wrapper.write(Type.COMPONENT, unsignedContent != null ? unsignedContent : signedContnet); + wrapper.write(Type.COMPONENT, unsignedContent != null ? unsignedContent : signedContent); - // Can only be 1 (chat) or 2 (game info) as per 1.18.2->1.19 transformer final int type = wrapper.read(Type.VAR_INT); - wrapper.write(Type.BOOLEAN, type == 1); // Overlay + wrapper.write(Type.BOOLEAN, type == 2); // Overlay, going by the default 1.19 chat type registry }); read(Type.UUID); // Sender uuid read(Type.COMPONENT); // Sender display name @@ -187,7 +187,7 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol { final byte[] publicKey = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); final byte[] nonce = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE); - wrapper.user().put(new NonceStorage(CipherUtil.signNonce(publicKey, nonce))); + wrapper.user().put(new NonceStorage(CipherUtil.encryptNonce(publicKey, nonce))); }); } }); diff --git a/common/src/main/java/com/viaversion/viaversion/util/CipherUtil.java b/common/src/main/java/com/viaversion/viaversion/util/CipherUtil.java index 93ba320c2..3ba951bf1 100644 --- a/common/src/main/java/com/viaversion/viaversion/util/CipherUtil.java +++ b/common/src/main/java/com/viaversion/viaversion/util/CipherUtil.java @@ -36,7 +36,7 @@ public final class CipherUtil { } } - public static byte[] signNonce(final byte[] publicKeyBytes, final byte[] nonceBytes) throws Exception { + public static byte[] encryptNonce(final byte[] publicKeyBytes, final byte[] nonceBytes) throws Exception { final EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes); final PublicKey key = RSA_FACTORY.generatePublic(keySpec); final Cipher cipher = Cipher.getInstance(key.getAlgorithm());