From 95bc340b065d2bb725808d50d681817d859ace06 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 12 Nov 2021 13:18:02 +0100 Subject: [PATCH] Fix play record, remove unused 1.18 code --- build.gradle.kts | 2 +- .../Protocol1_17_1To1_18.java | 2 +- .../packets/BlockItemPackets1_18.java | 28 ++++++++++--------- .../packets/EntityPackets1_18.java | 11 ++------ 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index ffddaf3c..798b4645 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { allprojects { group = "com.viaversion" - version = "4.1.0-21w44a-SNAPSHOT" + version = "4.1.0-1.18-pre1-SNAPSHOT" description = "Allow older clients to join newer server versions." } diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java index fcfeadb7..7a595aba 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/Protocol1_17_1To1_18.java @@ -78,7 +78,7 @@ public final class Protocol1_17_1To1_18 extends BackwardsProtocol { + int id = wrapper.get(Type.INT, 0); + int data = wrapper.get(Type.INT, 1); + if (id == 1010) { // Play record + wrapper.set(Type.INT, 1, protocol.getMappingData().getNewItemId(data)); + } + }); + } + }); registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM); @@ -162,12 +170,6 @@ public final class BlockItemPackets1_18 extends ItemRewriter blockEntityTags = new ArrayList<>(oldChunk.blockEntities().size()); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java index 172f60fc..5aab8b99 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/EntityPackets1_18.java @@ -44,12 +44,6 @@ public final class EntityPackets1_18 extends EntityRewriter { final CompoundTag registry = wrapper.get(Type.NBT, 0); @@ -127,11 +120,11 @@ public final class EntityPackets1_18 extends EntityRewriter