SPIGOT-7654: ItemStack#isSimilar does not work with empty BlockStateMeta
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -49,7 +49,18 @@
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
@@ -265,7 +289,7 @@
|
||||
@@ -260,12 +284,18 @@
|
||||
}
|
||||
|
||||
public final void applyComponents(DataComponentMap datacomponentmap, DataComponentPatch datacomponentpatch) {
|
||||
+ // CraftBukkit start
|
||||
+ this.applyComponentsSet(datacomponentmap, datacomponentpatch);
|
||||
+ }
|
||||
+
|
||||
+ public final Set<DataComponentType<?>> applyComponentsSet(DataComponentMap datacomponentmap, DataComponentPatch datacomponentpatch) {
|
||||
+ // CraftBukkit end
|
||||
final Set<DataComponentType<?>> set = new HashSet();
|
||||
|
||||
set.add(DataComponents.BLOCK_ENTITY_DATA);
|
||||
final PatchedDataComponentMap patcheddatacomponentmap = PatchedDataComponentMap.fromPatch(datacomponentmap, datacomponentpatch);
|
||||
|
||||
@@ -58,7 +69,18 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public <T> T get(DataComponentType<T> datacomponenttype) {
|
||||
@@ -317,6 +341,15 @@
|
||||
@@ -283,6 +313,10 @@
|
||||
DataComponentPatch datacomponentpatch1 = datacomponentpatch.forget(set::contains);
|
||||
|
||||
this.components = datacomponentpatch1.split().added();
|
||||
+ // CraftBukkit start
|
||||
+ set.remove(DataComponents.BLOCK_ENTITY_DATA); // Remove as never actually added by applyImplicitComponents
|
||||
+ return set;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
protected void collectImplicitComponents(DataComponentMap.a datacomponentmap_a) {}
|
||||
@@ -317,6 +351,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user