From ba4404fad6bab9bd130652ce96cad0419342c02d Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 10 Apr 2024 17:33:10 +0200 Subject: [PATCH] 1.20.5-pre1 --- .../api/protocol/version/ProtocolVersion.java | 2 +- .../rewriter/BlockItemPacketRewriter1_20_5.java | 15 ++++++++------- .../rewriter/EntityPacketRewriter1_20_5.java | 4 ++-- .../storage/AcknowledgedMessagesStorage.java | 7 +++++++ .../viaversion/rewriter/ItemRewriter.java | 10 ++++++++++ gradle.properties | 2 +- .../rewriter/BlockItemPacketRewriter1_99.java | 2 +- 7 files changed, 30 insertions(+), 12 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java index 6d5d7aab2..66b180f99 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java +++ b/api/src/main/java/com/viaversion/viaversion/api/protocol/version/ProtocolVersion.java @@ -83,7 +83,7 @@ public class ProtocolVersion implements Comparable { public static final ProtocolVersion v1_20 = register(763, "1.20/1.20.1", new SubVersionRange("1.20", 0, 1)); public static final ProtocolVersion v1_20_2 = register(764, "1.20.2"); public static final ProtocolVersion v1_20_3 = register(765, "1.20.3/1.20.4", new SubVersionRange("1.20", 3, 4)); - public static final ProtocolVersion v1_20_5 = register(766, 184, "1.20.5"); + public static final ProtocolVersion v1_20_5 = register(766, 185, "1.20.5"); public static final ProtocolVersion unknown = new ProtocolVersion(VersionType.SPECIAL, -1, -1, "UNKNOWN", null); public static ProtocolVersion register(int version, String name) { diff --git a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java index e7c9dd4c4..bc4f57f4b 100644 --- a/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java +++ b/common/src/main/java/com/viaversion/viaversion/protocols/protocol1_20_5to1_20_3/rewriter/BlockItemPacketRewriter1_20_5.java @@ -151,7 +151,13 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter { + final int slot = wrapper.read(Type.UNSIGNED_SHORT); + wrapper.write(Type.SHORT, (short) Math.min(slot, Short.MAX_VALUE)); + + final Item item = handleItemToServer(wrapper.read(Types1_20_5.ITEM)); + wrapper.write(Type.ITEM1_20_2, item); + }); registerWindowPropertyEnchantmentHandler(ClientboundPackets1_20_3.WINDOW_PROPERTY); protocol.registerClientbound(ClientboundPackets1_20_3.ADVANCEMENTS, wrapper -> { @@ -1049,11 +1055,6 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter handleServerboundItem(wrapper)); + } + }); + } + public void registerClickWindow(S packetType) { protocol.registerServerbound(packetType, new PacketHandlers() { @Override diff --git a/gradle.properties b/gradle.properties index 417aab75c..29454fd22 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project properties - we put these here so they can be modified without causing a recompile of the build scripts -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, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9, 1.8.9 diff --git a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java index 694c7ef51..cda081e44 100644 --- a/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java +++ b/template/src/main/java/com/viaversion/viaversion/template/protocols/rewriter/BlockItemPacketRewriter1_99.java @@ -60,7 +60,7 @@ public final class BlockItemPacketRewriter1_99 extends StructuredItemRewriter