public class AttributeManager.Property extends Object implements org.bukkit.attribute.AttributeInstance
Constructor and Description |
---|
Property(AttributeManager.Key key,
double value,
Collection<org.bukkit.attribute.AttributeModifier> modifiers)
Create a new property instance.
|
Property(AttributeManager.Key key,
double value,
Map<UUID,org.bukkit.attribute.AttributeModifier> modifiers,
double cachedValue,
boolean isCacheUpToDate) |
Modifier and Type | Method and Description |
---|---|
void |
addModifier(org.bukkit.attribute.AttributeModifier attributeModifier)
Add a modifier to this property.
|
org.bukkit.attribute.Attribute |
getAttribute() |
double |
getBaseValue()
Get the value before modifiers have been applied.
|
double |
getDefaultValue() |
AttributeManager.Key |
getKey() |
Collection<org.bukkit.attribute.AttributeModifier> |
getModifiers()
Get all modifiers assigned to this property.
|
double |
getValue()
Get value of this property after all modifiers have been applied.
|
void |
removeModifier(org.bukkit.attribute.AttributeModifier attributeModifier)
Remove an attribute from this property.
|
void |
setBaseValue(double value)
Set the base value on which modifiers are applied.
|
public Property(AttributeManager.Key key, double value, Collection<org.bukkit.attribute.AttributeModifier> modifiers)
key
- of the propertyvalue
- of the propertymodifiers
- of the propertypublic Property(AttributeManager.Key key, double value, Map<UUID,org.bukkit.attribute.AttributeModifier> modifiers, double cachedValue, boolean isCacheUpToDate)
public org.bukkit.attribute.Attribute getAttribute()
getAttribute
in interface org.bukkit.attribute.AttributeInstance
public double getDefaultValue()
getDefaultValue
in interface org.bukkit.attribute.AttributeInstance
public double getBaseValue()
getBaseValue
in interface org.bukkit.attribute.AttributeInstance
public void setBaseValue(double value)
setBaseValue
in interface org.bukkit.attribute.AttributeInstance
value
- new base valuepublic void addModifier(org.bukkit.attribute.AttributeModifier attributeModifier)
Attributes with the same uuid will be overridden according to https://minecraft.gamepedia.com/Attribute#Attributes
addModifier
in interface org.bukkit.attribute.AttributeInstance
attributeModifier
- to add to this propertypublic void removeModifier(org.bukkit.attribute.AttributeModifier attributeModifier)
removeModifier
in interface org.bukkit.attribute.AttributeInstance
attributeModifier
- to remove from this propertypublic double getValue()
getValue
in interface org.bukkit.attribute.AttributeInstance
public Collection<org.bukkit.attribute.AttributeModifier> getModifiers()
getModifiers
in interface org.bukkit.attribute.AttributeInstance
public AttributeManager.Key getKey()
Copyright © 2021. All rights reserved.