Paper
Paper copied to clipboard
Add addModifierIfAbsent and addTransientModifierIfAbsent to attribute instance class
Is your feature request related to a problem?
Just for convenience Before:
Attribute attribute = instance.getAttribute(xxx);
if(!attribute.getModifiers().contains(mod)) attribute.addModifier(mod);
After:
instance.getAttribute(xxx).addModifierIfAbsent(mod)
Describe the solution you'd like.
Just like above
Describe alternatives you've considered.
Ignore duplicated modifiers in the source code
Other
No response