From f42a308f2c1ceca5c8d1b8e2069e0985c7f831d2 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 21 Jul 2022 18:53:03 +0200 Subject: [PATCH] 1.19.1-rc2 --- .../api/protocol/version/ProtocolVersion.java | 2 +- .../com/viaversion/viaversion/api/type/Type.java | 1 + .../viaversion/api/type/types/StringType.java | 8 ++++++++ .../protocol1_19_1to1_19/Protocol1_19_1To1_19.java | 14 ++++++++++++-- gradle.properties | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index a768c6d59..37a465c34 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -81,7 +81,7 @@ public class ProtocolVersion { public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1)); public static final ProtocolVersion v1_18_2 = register(758, "1.18.2"); public static final ProtocolVersion v1_19 = register(759, "1.19"); - public static final ProtocolVersion v1_19_1 = register(760, 99, "1.19.1"); + public static final ProtocolVersion v1_19_1 = register(760, 100, "1.19.1"); public static final ProtocolVersion unknown = register(-1, "UNKNOWN"); public static ProtocolVersion register(int version, String name) { diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/Type.java b/api/src/main/java/com/viaversion/viaversion/api/type/Type.java index adaf14cb2..e2ea0ed68 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/Type.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/Type.java @@ -113,6 +113,7 @@ public abstract class Type implements ByteBufReader, ByteBufWriter { public static final Type OPTIONAL_COMPONENT = new OptionalComponentType(); public static final Type STRING = new StringType(); + public static final Type OPTIONAL_STRING = new StringType.OptionalStringType(); public static final Type STRING_ARRAY = new ArrayType<>(Type.STRING); public static final Type UUID = new UUIDType(); diff --git a/api/src/main/java/com/viaversion/viaversion/api/type/types/StringType.java b/api/src/main/java/com/viaversion/viaversion/api/type/types/StringType.java index 4c83f1d67..44f24e315 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/type/types/StringType.java +++ b/api/src/main/java/com/viaversion/viaversion/api/type/types/StringType.java @@ -23,6 +23,7 @@ package com.viaversion.viaversion.api.type.types; import com.google.common.base.Preconditions; +import com.viaversion.viaversion.api.type.OptionalType; import com.viaversion.viaversion.api.type.Type; import io.netty.buffer.ByteBuf; @@ -67,4 +68,11 @@ public class StringType extends Type { Type.VAR_INT.writePrimitive(buffer, b.length); buffer.writeBytes(b); } + + public static final class OptionalStringType extends OptionalType { + + public OptionalStringType() { + super(Type.STRING); + } + } } 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 b8b9b4705..9a5126ebe 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,7 +94,7 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol { - // Back to system chat - bye bye chat formats for 1.19.0 players + // Back to system chat - bye bye chat formats for 1.19.0 servers // ... 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); @@ -105,7 +105,7 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol