From 808b1fd2f0ed5d48a275a3b13fb0a476ed108be7 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sat, 22 Oct 2022 12:22:55 +0200 Subject: [PATCH] Finish mappings --- .../Protocol1_19_1To1_19_3.java | 25 +- .../data/mapping-1.19to1.19.3.json | 1280 ++++++++--------- 2 files changed, 657 insertions(+), 648 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java index 2180e785..81a8f29f 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_1to1_19_3/Protocol1_19_1To1_19_3.java @@ -30,7 +30,7 @@ import com.viaversion.viabackwards.protocol.protocol1_19_1to1_19_3.storage.Nonce import com.viaversion.viabackwards.protocol.protocol1_19to1_19_1.Protocol1_19To1_19_1; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.ProfileKey; -import com.viaversion.viaversion.api.minecraft.entities.Entity1_19Types; +import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_3Types; import com.viaversion.viaversion.api.protocol.packet.State; import com.viaversion.viaversion.api.protocol.remapper.PacketRemapper; import com.viaversion.viaversion.api.rewriter.EntityRewriter; @@ -285,12 +285,21 @@ public final class Protocol1_19_1To1_19_3 extends BackwardsProtocol { + final JsonElement content = wrapper.read(Type.COMPONENT); + translatableRewriter.processText(content); + final int chatTypeId = wrapper.read(Type.VAR_INT); + final JsonElement senderName = wrapper.read(Type.COMPONENT); + final JsonElement targetName = wrapper.read(Type.OPTIONAL_COMPONENT); + final JsonElement result = Protocol1_19To1_19_1.decorateChatMessage(wrapper.user().get(ChatTypeStorage1_19_3.class), chatTypeId, senderName, targetName, content); + if (result == null) { + wrapper.cancel(); + return; + } + + wrapper.write(Type.COMPONENT, result); + wrapper.write(Type.BOOLEAN, false); + }); } }); @@ -303,7 +312,7 @@ public final class Protocol1_19_1To1_19_3 extends BackwardsProtocol