mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-15 14:13:56 +01:00
Add transient modifier API
This commit is contained in:
parent
e48a6a04cc
commit
6c30e5b15b
2 changed files with 13 additions and 0 deletions
|
@ -23,6 +23,11 @@ public class UnmodifiableAttributeInstance extends CraftAttributeInstance {
|
|||
throw new UnsupportedOperationException("Cannot modify default attributes");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTransientModifier(AttributeModifier modifier) {
|
||||
throw new UnsupportedOperationException("Cannot modify default attributes");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeModifier(AttributeModifier modifier) {
|
||||
throw new UnsupportedOperationException("Cannot modify default attributes");
|
||||
|
|
|
@ -51,6 +51,14 @@ public class CraftAttributeInstance implements AttributeInstance {
|
|||
this.handle.addPermanentModifier(CraftAttributeInstance.convert(modifier));
|
||||
}
|
||||
|
||||
// Paper start - Transient modifier API
|
||||
@Override
|
||||
public void addTransientModifier(AttributeModifier modifier) {
|
||||
Preconditions.checkArgument(modifier != null, "modifier");
|
||||
this.handle.addTransientModifier(CraftAttributeInstance.convert(modifier));
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@Override
|
||||
public void removeModifier(AttributeModifier modifier) {
|
||||
Preconditions.checkArgument(modifier != null, "modifier");
|
||||
|
|
Loading…
Reference in a new issue