From f78d166acf46589b952cfc8f54f08dfabc07ef8e Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 12 Oct 2023 01:53:44 +1000 Subject: [PATCH] 23w41a (probably) --- .../Protocol1_20_2To1_20_3.java | 20 ++++++++++ .../rewriter/EntityPacketRewriter1_20_3.java | 2 + .../rewriter/ItemPacketRewriter1_20_3.java | 36 ++++++++++++++++++ .../data/mappings-1.20.3to1.20.2.nbt | Bin 0 -> 851 bytes gradle.properties | 2 +- settings.gradle.kts | 1 + 6 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/ItemPacketRewriter1_20_3.java create mode 100644 common/src/main/resources/assets/viabackwards/data/mappings-1.20.3to1.20.2.nbt diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java index 238af4a8..1907a827 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/Protocol1_20_2To1_20_3.java @@ -18,7 +18,10 @@ package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3; import com.viaversion.viabackwards.api.BackwardsProtocol; +import com.viaversion.viabackwards.api.data.BackwardsMappings; +import com.viaversion.viabackwards.api.rewriters.SoundRewriter; import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter.EntityPacketRewriter1_20_3; +import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter.ItemPacketRewriter1_20_3; import com.viaversion.viaversion.api.connection.UserConnection; import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_4Types; import com.viaversion.viaversion.api.protocol.packet.ClientboundPacketType; @@ -39,7 +42,9 @@ import java.util.BitSet; public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + public static final BackwardsMappings MAPPINGS = new BackwardsMappings("1.20.3", "1.20.2", Protocol1_20_3To1_20_2.class); private final EntityPacketRewriter1_20_3 entityRewriter = new EntityPacketRewriter1_20_3(this); + private final ItemPacketRewriter1_20_3 itemRewriter = new ItemPacketRewriter1_20_3(this); public Protocol1_20_2To1_20_3() { super(ClientboundPackets1_20_2.class, ClientboundPackets1_20_2.class, ServerboundPackets1_20_2.class, ServerboundPackets1_20_2.class); @@ -49,6 +54,11 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol soundRewriter = new SoundRewriter<>(this); + soundRewriter.register1_19_3Sound(ClientboundPackets1_20_2.SOUND); + soundRewriter.registerEntitySound(ClientboundPackets1_20_2.ENTITY_SOUND); + soundRewriter.registerStopSound(ClientboundPackets1_20_2.STOP_SOUND); + // Components are now (mostly) written as nbt instead of json strings registerClientbound(ClientboundPackets1_20_2.ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear @@ -256,6 +266,16 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol. + */ +package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter; + +import com.viaversion.viabackwards.api.rewriters.ItemRewriter; +import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.Protocol1_20_2To1_20_3; +import com.viaversion.viaversion.api.type.Type; +import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2; +import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2; + +public final class ItemPacketRewriter1_20_3 extends ItemRewriter { + + public ItemPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) { + super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_VAR_INT_ARRAY); + } + + @Override + public void registerPackets() { + registerSpawnParticle1_19(ClientboundPackets1_20_2.SPAWN_PARTICLE); + } +} \ No newline at end of file diff --git a/common/src/main/resources/assets/viabackwards/data/mappings-1.20.3to1.20.2.nbt b/common/src/main/resources/assets/viabackwards/data/mappings-1.20.3to1.20.2.nbt new file mode 100644 index 0000000000000000000000000000000000000000..8975e70dfd716ac7861e18602e791fca3b894ed4 GIT binary patch literal 851 zcmZ|N>2A|N7=_`JxNcL2tt4R$tTJxnv@?MY4EpH`Hp!e(ZWO0^L`r9T>ZKL(i zrKsLHNM$)QrbS)vv*H+8kwtJd>H){97kwz9A0EnBh1FPtwOEG%tj7jy#3l@4GqzwW zD%ghY*nyoG!Y=H_9_+Lpb^EqYQNr&(y9%UAm-(kH1z-F`bT4FX-UINdp?=4X~Skc VvCXhLYrc|Y!!(FZBh9x;e*u2oiS_^h literal 0 HcmV?d00001 diff --git a/gradle.properties b/gradle.properties index 76000989..3290800f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=4.9.0-23w40a-SNAPSHOT +projectVersion=4.9.0-23w41a-SNAPSHOT # Smile emoji mcVersions=1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10 diff --git a/settings.gradle.kts b/settings.gradle.kts index 3f90d2e9..ea46a82d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -4,6 +4,7 @@ rootProject.name = "viabackwards-parent" dependencyResolutionManagement { repositories { + mavenLocal() maven("https://repo.viaversion.com") maven("https://repo.papermc.io/repository/maven-public/") maven("https://oss.sonatype.org/content/repositories/snapshots/")