From 4f2a5bb7e2aa6d6dac4908597fe88720698ca8d2 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 28 Jul 2022 18:48:33 +0200 Subject: [PATCH] 4.4.1 Release --- .../Protocol1_19_1To1_19.java | 49 ++++++++++--------- gradle.properties | 2 +- 2 files changed, 27 insertions(+), 24 deletions(-) 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 7c71e073e..01fc5e13c 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 @@ -47,6 +47,7 @@ import com.viaversion.viaversion.protocols.protocol1_19_1to1_19.storage.NonceSto import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ClientboundPackets1_19; import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.ServerboundPackets1_19; import com.viaversion.viaversion.util.CipherUtil; +import org.checkerframework.checker.nullness.qual.Nullable; import java.io.IOException; import java.util.ArrayList; @@ -255,7 +256,7 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocolget(key).asByte() == 1); } } + componentBuilder.style(styleBuilder.build()); } - componentBuilder.style(styleBuilder.build()); // Add the replacements - final List arguments = new ArrayList<>(); final ListTag parameters = decoaration.get("parameters"); - if (parameters != null) for (final Tag element : parameters) { - JsonElement argument = null; - switch ((String) element.getValue()) { - case "sender": - argument = senderName; - break; - case "content": - argument = message; - break; - case "team_name": - Preconditions.checkNotNull(teamName, "Team name is null"); - argument = teamName; - break; - default: - Via.getPlatform().getLogger().warning("Unknown parameter for chat decoration: " + element.getValue()); - } - if (argument != null) { - arguments.add(GsonComponentSerializer.gson().deserializeFromTree(argument)); + if (parameters != null) { + final List arguments = new ArrayList<>(); + for (final Tag element : parameters) { + JsonElement argument = null; + switch ((String) element.getValue()) { + case "sender": + argument = senderName; + break; + case "content": + argument = message; + break; + case "team_name": + Preconditions.checkNotNull(teamName, "Team name is null"); + argument = teamName; + break; + default: + Via.getPlatform().getLogger().warning("Unknown parameter for chat decoration: " + element.getValue()); + } + if (argument != null) { + arguments.add(GsonComponentSerializer.gson().deserializeFromTree(argument)); + } } + componentBuilder.args(arguments); } - componentBuilder.args(arguments); wrapper.write(Type.COMPONENT, GsonComponentSerializer.gson().serializeToTree(componentBuilder.build())); wrapper.write(Type.BOOLEAN, overlay); diff --git a/gradle.properties b/gradle.properties index 63506377e..7d7f58a20 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -projectVersion=4.4.1-SNAPSHOT +projectVersion=4.4.1 # Gradle properties org.gradle.daemon=true