geforkt von Mirrors/Paper
Correct duplicate attribute check (#10901)
Brackets got lost during the update, leading to an incorrect precondition call.
Dieser Commit ist enthalten in:
Ursprung
59da9d1a80
Commit
8d4decb590
@ -13,7 +13,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
this.checkAttributeList();
|
||||
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
|
||||
- Preconditions.checkArgument(!entry.getValue().getKey().equals(modifier.getKey()), "Cannot register AttributeModifier. Modifier is already applied! %s", modifier);
|
||||
+ Preconditions.checkArgument(!entry.getValue().getKey().equals(modifier.getKey()) && entry.getKey() == attribute, "Cannot register AttributeModifier. Modifier is already applied! %s", modifier); // Paper - attribute modifiers with same namespaced key but on different attributes are fine
|
||||
+ Preconditions.checkArgument(!(entry.getValue().getKey().equals(modifier.getKey()) && entry.getKey() == attribute), "Cannot register AttributeModifier. Modifier is already applied! %s", modifier); // Paper - attribute modifiers with same namespaced key but on different attributes are fine
|
||||
}
|
||||
return this.attributeModifiers.put(attribute, modifier);
|
||||
}
|
||||
|
@ -982,7 +982,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
- this.checkAttributeList();
|
||||
+ if (this.attributeModifiers != null) { // Paper
|
||||
for (Map.Entry<Attribute, AttributeModifier> entry : this.attributeModifiers.entries()) {
|
||||
Preconditions.checkArgument(!entry.getValue().getKey().equals(modifier.getKey()) && entry.getKey() == attribute, "Cannot register AttributeModifier. Modifier is already applied! %s", modifier); // Paper - attribute modifiers with same namespaced key but on different attributes are fine
|
||||
Preconditions.checkArgument(!(entry.getValue().getKey().equals(modifier.getKey()) && entry.getKey() == attribute), "Cannot register AttributeModifier. Modifier is already applied! %s", modifier); // Paper - attribute modifiers with same namespaced key but on different attributes are fine
|
||||
}
|
||||
+ } // Paper
|
||||
+ this.checkAttributeList(); // Paper - moved down
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren