From d2edf3fbfe933d93cd2175792a799d0686975131 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 10 Apr 2024 17:41:19 +0200 Subject: [PATCH] 1.20.5-pre1 --- .../rewriter/BlockItemPacketRewriter1_20_5.java | 9 ++++++++- gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- .../protocol/rewriter/BlockItemPacketRewriter1_99.java | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java index bbdb0511..88ef8a66 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_20_3to1_20_5/rewriter/BlockItemPacketRewriter1_20_5.java @@ -62,8 +62,15 @@ public final class BlockItemPacketRewriter1_20_5 extends BackwardsStructuredItem registerSetSlot1_17_1(ClientboundPackets1_20_5.SET_SLOT); registerAdvancements1_20_3(ClientboundPackets1_20_5.ADVANCEMENTS); registerClickWindow1_17_1(ServerboundPackets1_20_3.CLICK_WINDOW); - registerCreativeInvAction(ServerboundPackets1_20_3.CREATIVE_INVENTORY_ACTION); registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_5.WINDOW_PROPERTY); + protocol.registerServerbound(ServerboundPackets1_20_3.CREATIVE_INVENTORY_ACTION, wrapper -> { + final short slot = wrapper.read(Type.SHORT); + wrapper.write(Type.UNSIGNED_SHORT, (int) slot); // Just write as is. Negative numbers become large numbers, staying invalid + + final Item item = wrapper.read(Type.ITEM1_20_2); + final Item newItem = handleItemToServer(item); + wrapper.write(Types1_20_5.ITEM, newItem); + }); protocol.registerClientbound(ClientboundPackets1_20_5.SPAWN_PARTICLE, wrapper -> { wrapper.write(Type.VAR_INT, 0); // Write dummy value, set later diff --git a/gradle.properties b/gradle.properties index 2b67b3d4..d3bf748b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -projectVersion=4.10.0-24w14a-SNAPSHOT +projectVersion=4.10.0-1.20.5-pre1-SNAPSHOT # Smile emoji mcVersions=1.20.4, 1.20.3, 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 3175f10c..d098fee3 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-24w14a-SNAPSHOT" +viaver = "4.10.0-1.20.5-pre1-SNAPSHOT" # Common provided netty = "4.0.20.Final" diff --git a/template/src/main/java/com/viaversion/viabackwards/template/protocol/rewriter/BlockItemPacketRewriter1_99.java b/template/src/main/java/com/viaversion/viabackwards/template/protocol/rewriter/BlockItemPacketRewriter1_99.java index 1c96ac5c..b335531d 100644 --- a/template/src/main/java/com/viaversion/viabackwards/template/protocol/rewriter/BlockItemPacketRewriter1_99.java +++ b/template/src/main/java/com/viaversion/viabackwards/template/protocol/rewriter/BlockItemPacketRewriter1_99.java @@ -55,7 +55,7 @@ public final class BlockItemPacketRewriter1_99 extends BackwardsStructuredItemRe registerEntityEquipmentArray(ClientboundPackets1_20_5.ENTITY_EQUIPMENT); registerClickWindow1_17_1(ServerboundPackets1_20_5.CLICK_WINDOW); registerTradeList1_20_5(ClientboundPackets1_20_5.TRADE_LIST, Types1_20_5.ITEM_COST, Types1_20_5.ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST, Types1_20_5.OPTIONAL_ITEM_COST); - registerCreativeInvAction(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION); + registerCreativeInvAction1_20_5(ServerboundPackets1_20_5.CREATIVE_INVENTORY_ACTION); registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_5.WINDOW_PROPERTY); registerSpawnParticle1_20_5(ClientboundPackets1_20_5.SPAWN_PARTICLE, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE); registerExplosion(ClientboundPackets1_20_5.EXPLOSION, Types1_20_5.PARTICLE, Types1_20_5.PARTICLE);