From 9807eece725b2b2e5e4df6a2f711f9068d42ac02 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 17 Feb 2023 23:36:44 +0100 Subject: [PATCH] And now there's mappings --- .../Protocol1_19_3To1_19_4.java | 18 +- .../packets/BlockItemPackets1_19_4.java | 4 +- .../data/mapping-1.19.3to1.19.4.json | 276 ++++++++++++++++++ 3 files changed, 289 insertions(+), 9 deletions(-) create mode 100644 common/src/main/resources/assets/viabackwards/data/mapping-1.19.3to1.19.4.json diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java index dd1a2ee1..7e827dca 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/Protocol1_19_3To1_19_4.java @@ -19,8 +19,8 @@ package com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4; import com.viaversion.viabackwards.api.BackwardsProtocol; import com.viaversion.viabackwards.api.data.BackwardsMappings; -import com.viaversion.viabackwards.api.rewriters.ItemRewriter; import com.viaversion.viabackwards.api.rewriters.SoundRewriter; +import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.packets.BlockItemPackets1_19_4; import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.packets.EntityPackets1_19_4; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types; @@ -40,9 +40,9 @@ import java.util.Base64; public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol { - public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.19.4", "1.19.3", Protocol1_19_4To1_19_3.class); + public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.19.4", "1.19.3", Protocol1_19_4To1_19_3.class, true); private final EntityPackets1_19_4 entityRewriter = new EntityPackets1_19_4(this); - private final ItemRewriter itemRewriter = new ItemRewriter<>(this); + private final BlockItemPackets1_19_4 itemRewriter = new BlockItemPackets1_19_4(this); public Protocol1_19_3To1_19_4() { super(ClientboundPackets1_19_4.class, ClientboundPackets1_19_3.class, ServerboundPackets1_19_4.class, ServerboundPackets1_19_3.class); @@ -51,17 +51,19 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol { MAPPINGS.load(); entityRewriter.onMappingDataLoaded(); }); entityRewriter.register(); + itemRewriter.register(); final SoundRewriter soundRewriter = new SoundRewriter<>(this); soundRewriter.registerStopSound(ClientboundPackets1_19_4.STOP_SOUND); soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.SOUND); - soundRewriter.register1_19_3Sound(ClientboundPackets1_19_4.ENTITY_SOUND); + soundRewriter.registerSound(ClientboundPackets1_19_4.ENTITY_SOUND); new CommandRewriter(this) { @Override @@ -86,9 +88,9 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol getItemRewriter() { + public BlockItemPackets1_19_4 getItemRewriter() { return itemRewriter; } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/BlockItemPackets1_19_4.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/BlockItemPackets1_19_4.java index 7c15ebde..14043c95 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/BlockItemPackets1_19_4.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_19_3to1_19_4/packets/BlockItemPackets1_19_4.java @@ -81,7 +81,9 @@ public final class BlockItemPackets1_19_4 extends ItemRewriter