From d195996997490ae989e95fb3c338298b247bf00b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Thu, 25 Apr 2024 07:26:03 +1000 Subject: [PATCH] SPIGOT-7631: Fix deserialisation of BlockStateMeta By: md_5 --- .../bukkit/craftbukkit/inventory/CraftMetaBlockState.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java index 5df772c9a0..db61860f43 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBlockState.java @@ -171,6 +171,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta final Material material; private CraftBlockEntityState blockEntityTag; + private NBTTagCompound internalTag; CraftMetaBlockState(CraftMetaItem meta, Material material) { super(meta); @@ -222,7 +223,8 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta } else { material = Material.AIR; } - blockEntityTag = getBlockState(material, null); + blockEntityTag = getBlockState(material, internalTag); + internalTag = null; } @Override @@ -243,7 +245,7 @@ public class CraftMetaBlockState extends CraftMetaItem implements BlockStateMeta super.deserializeInternal(tag, context); if (tag.contains(BLOCK_ENTITY_TAG.NBT, CraftMagicNumbers.NBT.TAG_COMPOUND)) { - blockEntityTag = getBlockState(material, tag.getCompound(BLOCK_ENTITY_TAG.NBT)); + internalTag = tag.getCompound(BLOCK_ENTITY_TAG.NBT); } }