Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Add addModifierIfAbsent and addTransientModifierIfAbsent to attribute instance class

Open Clexus opened this issue 1 month ago • 0 comments

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

Clexus avatar Dec 09 '25 13:12 Clexus