Fix BlockStateMeta equals (#10795)
This commit is contained in:
@@ -236,6 +236,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
- this.blockEntityTag = blockEntityTag;
|
- this.blockEntityTag = blockEntityTag;
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
+ for (final DataComponentType type : applied) {
|
+ for (final DataComponentType type : applied) {
|
||||||
|
+ if (CraftMetaItem.DEFAULT_HANDLED_DCTS.contains(type)) continue;
|
||||||
+ getOrEmpty(tag, type).ifPresent(value -> {
|
+ getOrEmpty(tag, type).ifPresent(value -> {
|
||||||
+ map.set(type, value);
|
+ map.set(type, value);
|
||||||
+ });
|
+ });
|
||||||
@@ -403,6 +404,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ }
|
+ }
|
||||||
+ final PatchedDataComponentMap patchedMap = new PatchedDataComponentMap(nmsBlockState.getBlock().asItem().components());
|
+ final PatchedDataComponentMap patchedMap = new PatchedDataComponentMap(nmsBlockState.getBlock().asItem().components());
|
||||||
+ patchedMap.setAll(this.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());
|
+ blockEntity.applyComponents(nmsBlockState.getBlock().asItem().components(), patchedMap.asPatch());
|
||||||
+
|
+
|
||||||
+ // This is expected to always return a CraftBlockEntityState for the passed material:
|
+ // This is expected to always return a CraftBlockEntityState for the passed material:
|
||||||
|
|||||||
Reference in New Issue
Block a user