From 59fc7f6a1a7c4ad3347bf956d511a19d00184b47 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 26 Oct 2023 13:13:23 +1000 Subject: [PATCH] 23w43a --- .../Protocol1_10To1_11.java | 2 +- .../Protocol1_11_1To1_12.java | 2 +- .../Protocol1_11To1_11_1.java | 2 +- .../Protocol1_12_2To1_13.java | 2 +- .../Protocol1_13_2To1_14.java | 2 +- .../Protocol1_13To1_13_1.java | 2 +- .../Protocol1_15_2To1_16.java | 2 +- .../Protocol1_20_2To1_20_3.java | 67 +++++++++++------- .../BlockItemPacketRewriter1_20_3.java | 34 ++++----- .../rewriter/EntityPacketRewriter1_20_3.java | 14 ++-- .../Protocol1_9_1_2To1_9_3_4.java | 2 +- .../Protocol1_9_4To1_10.java | 2 +- .../data/mappings-1.20.3to1.20.2.nbt | Bin 1362 -> 5718 bytes gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- 15 files changed, 76 insertions(+), 61 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java index 23cb073d..a550b22e 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_10to1_11/Protocol1_10To1_11.java @@ -57,7 +57,7 @@ public class Protocol1_10To1_11 extends BackwardsProtocol { +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 BlockItemPacketRewriter1_20_3 itemRewriter = new BlockItemPacketRewriter1_20_3(this); public Protocol1_20_2To1_20_3() { - super(ClientboundPackets1_20_2.class, ClientboundPackets1_20_2.class, ServerboundPackets1_20_3.class, ServerboundPackets1_20_2.class); + super(ClientboundPackets1_20_3.class, ClientboundPackets1_20_2.class, ServerboundPackets1_20_3.class, ServerboundPackets1_20_2.class); } @Override protected void registerPackets() { super.registerPackets(); - final SoundRewriter 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); + final SoundRewriter soundRewriter = new SoundRewriter<>(this); + soundRewriter.register1_19_3Sound(ClientboundPackets1_20_3.SOUND); + soundRewriter.registerEntitySound(ClientboundPackets1_20_3.ENTITY_SOUND); + soundRewriter.registerStopSound(ClientboundPackets1_20_3.STOP_SOUND); + + cancelClientbound(ClientboundPackets1_20_3.TICKING_STATE); + cancelClientbound(ClientboundPackets1_20_3.TICKING_STEP); + + registerServerbound(ServerboundPackets1_20_2.UPDATE_JIGSAW_BLOCK, wrapper -> { + wrapper.passthrough(Type.POSITION1_14); // Position + wrapper.passthrough(Type.STRING); // Name + wrapper.passthrough(Type.STRING); // Target + wrapper.passthrough(Type.STRING); // Pool + wrapper.passthrough(Type.STRING); // Final state + wrapper.passthrough(Type.STRING); // Joint type + wrapper.write(Type.VAR_INT, 0); // Selection priority + wrapper.write(Type.VAR_INT, 0); // Placement priority + }); // Components are now (mostly) written as nbt instead of json strings - registerClientbound(ClientboundPackets1_20_2.ADVANCEMENTS, wrapper -> { + registerClientbound(ClientboundPackets1_20_3.ADVANCEMENTS, wrapper -> { wrapper.passthrough(Type.BOOLEAN); // Reset/clear final int size = wrapper.passthrough(Type.VAR_INT); // Mapping size for (int i = 0; i < size; i++) { @@ -94,7 +109,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.TAB_COMPLETE, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Transaction id wrapper.passthrough(Type.VAR_INT); // Start wrapper.passthrough(Type.VAR_INT); // Length @@ -105,7 +120,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.MAP_DATA, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Map id wrapper.passthrough(Type.BYTE); // Scale wrapper.passthrough(Type.BOOLEAN); // Locked @@ -120,7 +135,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.BOSSBAR, wrapper -> { wrapper.passthrough(Type.UUID); // Id final int action = wrapper.passthrough(Type.VAR_INT); @@ -128,7 +143,7 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.PLAYER_CHAT, wrapper -> { wrapper.passthrough(Type.UUID); // Sender wrapper.passthrough(Type.VAR_INT); // Index wrapper.passthrough(Type.OPTIONAL_SIGNATURE_BYTES); // Signature @@ -155,14 +170,14 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.SCOREBOARD_OBJECTIVE, wrapper -> { wrapper.passthrough(Type.STRING); // Objective Name final byte action = wrapper.passthrough(Type.BYTE); // Mode if (action == 0 || action == 2) { convertComponent(wrapper); // Display Name } }); - registerClientbound(ClientboundPackets1_20_2.TEAMS, wrapper -> { + registerClientbound(ClientboundPackets1_20_3.TEAMS, wrapper -> { wrapper.passthrough(Type.STRING); // Team Name final byte action = wrapper.passthrough(Type.BYTE); // Mode if (action == 0 || action == 2) { @@ -178,15 +193,15 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.DISCONNECT, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.RESOURCE_PACK, resourcePackHandler()); + registerClientbound(ClientboundPackets1_20_3.SERVER_DATA, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.ACTIONBAR, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.TITLE_TEXT, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.TITLE_SUBTITLE, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.DISGUISED_CHAT, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.SYSTEM_CHAT, this::convertComponent); + registerClientbound(ClientboundPackets1_20_3.OPEN_WINDOW, wrapper -> { wrapper.passthrough(Type.VAR_INT); // Container id final int containerTypeId = wrapper.read(Type.VAR_INT); @@ -200,19 +215,19 @@ public final class Protocol1_20_2To1_20_3 extends BackwardsProtocol { + registerClientbound(ClientboundPackets1_20_3.TAB_LIST, wrapper -> { convertComponent(wrapper); convertComponent(wrapper); }); - registerClientbound(ClientboundPackets1_20_2.COMBAT_KILL, new PacketHandlers() { + registerClientbound(ClientboundPackets1_20_3.COMBAT_KILL, new PacketHandlers() { @Override public void register() { map(Type.VAR_INT); // Duration handler(wrapper -> convertComponent(wrapper)); } }); - registerClientbound(ClientboundPackets1_20_2.PLAYER_INFO_UPDATE, wrapper -> { + registerClientbound(ClientboundPackets1_20_3.PLAYER_INFO_UPDATE, wrapper -> { final BitSet actions = wrapper.passthrough(Type.PROFILE_ACTIONS_ENUM); final int entries = wrapper.passthrough(Type.VAR_INT); for (int i = 0; i < entries; i++) { diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java index d7aa14ce..0f1f2c08 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/BlockItemPacketRewriter1_20_3.java @@ -21,12 +21,12 @@ 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.api.type.types.chunk.ChunkType1_20_2; -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; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.rewriter.RecipeRewriter1_20_2; +import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; import com.viaversion.viaversion.rewriter.BlockRewriter; -public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter { +public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter { public BlockItemPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) { super(protocol, Type.ITEM1_20_2, Type.ITEM1_20_2_ARRAY); @@ -34,24 +34,24 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter blockRewriter = BlockRewriter.for1_20_2(protocol); - blockRewriter.registerBlockAction(ClientboundPackets1_20_2.BLOCK_ACTION); - blockRewriter.registerBlockChange(ClientboundPackets1_20_2.BLOCK_CHANGE); - blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_2.MULTI_BLOCK_CHANGE); - blockRewriter.registerEffect(ClientboundPackets1_20_2.EFFECT, 1010, 2001); - blockRewriter.registerChunkData1_19(ClientboundPackets1_20_2.CHUNK_DATA, ChunkType1_20_2::new); - blockRewriter.registerBlockEntityData(ClientboundPackets1_20_2.BLOCK_ENTITY_DATA); + final BlockRewriter blockRewriter = BlockRewriter.for1_20_2(protocol); + blockRewriter.registerBlockAction(ClientboundPackets1_20_3.BLOCK_ACTION); + blockRewriter.registerBlockChange(ClientboundPackets1_20_3.BLOCK_CHANGE); + blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_3.MULTI_BLOCK_CHANGE); + blockRewriter.registerEffect(ClientboundPackets1_20_3.EFFECT, 1010, 2001); + blockRewriter.registerChunkData1_19(ClientboundPackets1_20_3.CHUNK_DATA, ChunkType1_20_2::new); + blockRewriter.registerBlockEntityData(ClientboundPackets1_20_3.BLOCK_ENTITY_DATA); - registerSetCooldown(ClientboundPackets1_20_2.COOLDOWN); - registerWindowItems1_17_1(ClientboundPackets1_20_2.WINDOW_ITEMS); - registerSetSlot1_17_1(ClientboundPackets1_20_2.SET_SLOT); - registerEntityEquipmentArray(ClientboundPackets1_20_2.ENTITY_EQUIPMENT); + registerSetCooldown(ClientboundPackets1_20_3.COOLDOWN); + registerWindowItems1_17_1(ClientboundPackets1_20_3.WINDOW_ITEMS); + registerSetSlot1_17_1(ClientboundPackets1_20_3.SET_SLOT); + registerEntityEquipmentArray(ClientboundPackets1_20_3.ENTITY_EQUIPMENT); registerClickWindow1_17_1(ServerboundPackets1_20_2.CLICK_WINDOW); - registerTradeList1_19(ClientboundPackets1_20_2.TRADE_LIST); + registerTradeList1_19(ClientboundPackets1_20_3.TRADE_LIST); registerCreativeInvAction(ServerboundPackets1_20_2.CREATIVE_INVENTORY_ACTION); - registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_2.WINDOW_PROPERTY); - registerSpawnParticle1_19(ClientboundPackets1_20_2.SPAWN_PARTICLE); + registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_3.WINDOW_PROPERTY); + registerSpawnParticle1_19(ClientboundPackets1_20_3.SPAWN_PARTICLE); - new RecipeRewriter1_20_2<>(protocol).register(ClientboundPackets1_20_2.DECLARE_RECIPES); + new RecipeRewriter1_20_2<>(protocol).register(ClientboundPackets1_20_3.DECLARE_RECIPES); } } \ No newline at end of file diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java index ea4884e4..d6cbda86 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_2to1_20_3/rewriter/EntityPacketRewriter1_20_3.java @@ -28,10 +28,10 @@ import com.viaversion.viaversion.api.type.Type; import com.viaversion.viaversion.api.type.types.version.Types1_20_2; import com.viaversion.viaversion.api.type.types.version.Types1_20_3; import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundConfigurationPackets1_20_2; -import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2; import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.Protocol1_20_3To1_20_2; +import com.viaversion.viaversion.protocols.protocol1_20_3to1_20_2.packet.ClientboundPackets1_20_3; -public final class EntityPacketRewriter1_20_3 extends EntityRewriter { +public final class EntityPacketRewriter1_20_3 extends EntityRewriter { public EntityPacketRewriter1_20_3(final Protocol1_20_2To1_20_3 protocol) { super(protocol); @@ -39,9 +39,9 @@ public final class EntityPacketRewriter1_20_3 extends EntityRewriter1&48GzrN&yzSdZ9~$!agN4G)AWe4cz12D4F%c+RHU}FY64cP#=B$hcs*pj zyX=m0l(U@WXeli;^pFq|KS1>2l#uwvFaAJJpyfV#0Hs_#D6~+Xxp!t~*HR^fu=IHS z&HH}uyyrKw9uiTq_K4YPTaCJiWQJsTzSdYc+_nwdY%3XBHkwVda=^OA6q$QCBbrso zC>dzG7narxi)Pqte6PsJqavGchdV^BxC+W}ugHOC;W>Cw z9+4}*2w#FP!&l%=k*h1f^{XEfIkXE{A7Xuo^&IOt)^n`qSeICrSeICrSeIFsS(ov= zya-iT0t?;&hoJ_`K=9=TG~u1lf;JFac?FKZQ8)(2;Tm`syc^yF#9w|NydSQG55NcE zL-1kv2z(T-gO9<-;S=ylk?N1&$M6V{!|G4qr|>iQIs5{C3BQ70!*AfX@EAM}PXIZr z{tkW*e}JdpkMK173H}U!fxp7v;2EGURq9fG9{vt5z(3%hK&`4T!N1_&@UjT0lcfx3 zpkM%W8o(xTZUf-B+XOT~aav^ZyCN5o&?~Ntu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%%X#6om31mJ#>m`gj&Mj+?El z&5KyG;We0lSDUx8(!Bc`6h-Mf+bIhi^2^vMiigoDNk-o(3$o^yxaq$OmK>eP6F;YM XY2b?=LR{#3lWI2fC)KRyk;s1lzEwm6 delta 435 zcmXxfJ1;|F9LMqh>2t^_9mLR~gBUF05=SLEC<8I#4d_V+Vi8GmHWGsuK=O<_*p)>r zUPeRR@3+#r-|xOI&+s|J|Mr|;u0C5f)iLhb^Vh!{Y z8`#7awy}d<>|q}VIK&Z-ae`CiafWjgP{hSBpG#cf8aKGb9q#dfM?B#fFL=cp-tmD? ze2I8u@GJzNNac_Gr{a%)lcn{fTGTTtq`U0eCRH@aZRR*&wIU{>3TBxG2mhKe-Cx>J zW9Q8huc$f9n_&u8_@}75ow{h&%sG_X5Jx+D(2G8il2MGAeMb)ks}`1m6IMlwDSY@*S diff --git a/gradle.properties b/gradle.properties index 23c0416b..e5c088d6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=4.9.0-23w42a-SNAPSHOT +projectVersion=4.9.0-23w43a-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/gradle/libs.versions.toml b/gradle/libs.versions.toml index 389da106..8d0bfd6b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ metadata.format.version = "1.1" [versions] # ViaVersion -viaver = "4.9.0-23w42a-SNAPSHOT" +viaver = "4.9.0-23w43a-SNAPSHOT" # Common provided netty = "4.0.20.Final"