From f687dff7022885f054d427eb3db8073ea70b186a Mon Sep 17 00:00:00 2001 From: Lucas Date: Sat, 4 Dec 2021 11:36:46 -0400 Subject: [PATCH] Add missing block entity NBT on 1.18 (#414) --- .../packets/BlockItemPackets1_18.java | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/BlockItemPackets1_18.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/BlockItemPackets1_18.java index e6f70777..a449b03b 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/BlockItemPackets1_18.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_17_1to1_18/packets/BlockItemPackets1_18.java @@ -22,6 +22,7 @@ import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.Protocol1_17_1T import com.viaversion.viabackwards.protocol.protocol1_17_1to1_18.data.BlockEntityIds; import com.viaversion.viaversion.api.data.ParticleMappings; import com.viaversion.viaversion.api.data.entity.EntityTracker; +import com.viaversion.viaversion.api.minecraft.Position; import com.viaversion.viaversion.api.minecraft.blockentity.BlockEntity; import com.viaversion.viaversion.api.minecraft.chunks.BaseChunk; import com.viaversion.viaversion.api.minecraft.chunks.Chunk; @@ -131,11 +132,6 @@ public final class BlockItemPackets1_18 extends ItemRewriter { final int id = wrapper.read(Type.VAR_INT); final CompoundTag tag = wrapper.read(Type.NBT); - if (tag == null) { - // Cancel nbt-less updates (screw open commandblocks) - wrapper.cancel(); - return; - } final int mappedId = BlockEntityIds.mappedId(id); if (mappedId == -1) { @@ -143,9 +139,30 @@ public final class BlockItemPackets1_18 extends ItemRewriter