From 2b16bc2a306739ba6eb71bb7553691e3b14c5d3e Mon Sep 17 00:00:00 2001 From: Jake Potrebic <jake.m.potrebic@gmail.com> Date: Sun, 26 May 2024 13:49:00 -0700 Subject: [PATCH] Fix BlockStateMeta equals (#10795) --- patches/server/General-ItemMeta-fixes.patch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/patches/server/General-ItemMeta-fixes.patch b/patches/server/General-ItemMeta-fixes.patch index 3e4f93b47a..1d47f7d3bd 100644 --- a/patches/server/General-ItemMeta-fixes.patch +++ b/patches/server/General-ItemMeta-fixes.patch @@ -236,6 +236,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 - this.blockEntityTag = blockEntityTag; + // Paper start + for (final DataComponentType type : applied) { ++ if (CraftMetaItem.DEFAULT_HANDLED_DCTS.contains(type)) continue; + getOrEmpty(tag, type).ifPresent(value -> { + map.set(type, value); + }); @@ -403,6 +404,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } + final PatchedDataComponentMap patchedMap = new PatchedDataComponentMap(nmsBlockState.getBlock().asItem().components()); + patchedMap.setAll(this.components); ++ final Applicator applicator = new Applicator() {}; ++ super.applyToItem(applicator); ++ patchedMap.applyPatch(applicator.build()); + blockEntity.applyComponents(nmsBlockState.getBlock().asItem().components(), patchedMap.asPatch()); + + // This is expected to always return a CraftBlockEntityState for the passed material: