From e9db3f040f942c3decae573a558f4bff9f2635a2 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 1 May 2024 10:35:48 +0200 Subject: [PATCH] Check both namespaced and implicit key when replacing registries --- .../viaversion/viabackwards/api/ViaBackwardsPlatform.java | 2 +- .../protocol1_18_2to1_19/packets/EntityPackets1_19.java | 7 +------ .../packets/EntityPackets1_19_3.java | 1 + .../protocol1_19to1_19_1/Protocol1_19To1_19_1.java | 2 +- gradle/libs.versions.toml | 2 +- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java index fd6fd7aa..becb429a 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/ViaBackwardsPlatform.java @@ -68,7 +68,7 @@ import java.util.logging.Logger; public interface ViaBackwardsPlatform { - String MINIMUM_VV_VERSION = "4.10.0"; + String MINIMUM_VV_VERSION = "4.10.1"; /** * Initialize ViaBackwards. diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java index d5b4ff46..b93e32d2 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_18_2to1_19/packets/EntityPackets1_19.java @@ -155,12 +155,7 @@ public final class EntityPackets1_19 extends EntityRewriter chatTypes = chatTypeRegistry.getListTag("value", CompoundTag.class); + final ListTag chatTypes = TagUtil.removeRegistryEntries(registry, "chat_type"); for (final CompoundTag chatType : chatTypes) { final NumberTag idTag = chatType.getNumberTag("id"); dimensionRegistryStorage.addChatType(idTag.asInt(), chatType); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/packets/EntityPackets1_19_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/packets/EntityPackets1_19_3.java index 0f05e0e4..51aeff3f 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/packets/EntityPackets1_19_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/packets/EntityPackets1_19_3.java @@ -81,6 +81,7 @@ public final class EntityPackets1_19_3 extends EntityRewriter { final ChatTypeStorage1_19_3 chatTypeStorage = wrapper.user().get(ChatTypeStorage1_19_3.class); chatTypeStorage.clear(); + final CompoundTag registry = wrapper.get(Type.NAMED_COMPOUND_TAG, 0); final ListTag chatTypes = TagUtil.getRegistryEntries(registry, "chat_type"); for (final CompoundTag chatType : chatTypes) { diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19to1_19_1/Protocol1_19To1_19_1.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19to1_19_1/Protocol1_19To1_19_1.java index 432ae2db..df3647f1 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19to1_19_1/Protocol1_19To1_19_1.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19to1_19_1/Protocol1_19To1_19_1.java @@ -103,7 +103,7 @@ public final class Protocol1_19To1_19_1 extends BackwardsProtocol chatTypes = TagUtil.getRegistryEntries(registry, "chat_type"); + final ListTag chatTypes = TagUtil.removeRegistryEntries(registry, "chat_type"); for (final CompoundTag chatType : chatTypes) { final NumberTag idTag = chatType.getNumberTag("id"); chatTypeStorage.addChatType(idTag.asInt(), chatType); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 79a9f2d6..2892562c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ metadata.format.version = "1.1" [versions] # ViaVersion -viaver = "4.10.0" +viaver = "4.10.1-SNAPSHOT" # Common provided netty = "4.0.20.Final"