mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
distinguish between null and empty map in API (#10829)
This commit is contained in:
@@ -954,7 +954,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
return this.attributeModifiers.put(attribute, modifier);
|
||||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta {
|
||||
@Override
|
||||
public void setAttributeModifiers(@Nullable Multimap<Attribute, AttributeModifier> attributeModifiers) {
|
||||
- if (attributeModifiers == null || attributeModifiers.isEmpty()) {
|
||||
+ // Paper start - distinguish between null and empty
|
||||
+ if (attributeModifiers == null) {
|
||||
+ this.attributeModifiers = null;
|
||||
+ return;
|
||||
+ }
|
||||
+ if (attributeModifiers.isEmpty()) {
|
||||
+ // Paper end - distinguish between null and empty
|
||||
this.attributeModifiers = LinkedHashMultimap.create();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user