Class ModifiableAttributeInstance
- java.lang.Object
-
- net.minecraft.entity.ai.attributes.ModifiableAttributeInstance
-
public class ModifiableAttributeInstance extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private Attribute
attribute
private double
baseValue
private double
cachedValue
private boolean
dirty
private java.util.Map<java.util.UUID,AttributeModifier>
modifierById
private java.util.Map<AttributeModifier.Operation,java.util.Set<AttributeModifier>>
modifiersByOperation
private java.util.function.Consumer<ModifiableAttributeInstance>
onDirty
private java.util.Set<AttributeModifier>
permanentModifiers
-
Constructor Summary
Constructors Constructor Description ModifiableAttributeInstance(Attribute p_i231501_1_, java.util.function.Consumer<ModifiableAttributeInstance> p_i231501_2_)
-
Method Summary
-
-
-
Field Detail
-
attribute
private final Attribute attribute
-
modifiersByOperation
private final java.util.Map<AttributeModifier.Operation,java.util.Set<AttributeModifier>> modifiersByOperation
-
modifierById
private final java.util.Map<java.util.UUID,AttributeModifier> modifierById
-
permanentModifiers
private final java.util.Set<AttributeModifier> permanentModifiers
-
baseValue
private double baseValue
-
dirty
private boolean dirty
-
cachedValue
private double cachedValue
-
onDirty
private final java.util.function.Consumer<ModifiableAttributeInstance> onDirty
-
-
Constructor Detail
-
ModifiableAttributeInstance
public ModifiableAttributeInstance(Attribute p_i231501_1_, java.util.function.Consumer<ModifiableAttributeInstance> p_i231501_2_)
-
-
Method Detail
-
getAttribute
public Attribute getAttribute()
-
getBaseValue
public double getBaseValue()
-
setBaseValue
public void setBaseValue(double p_111128_1_)
-
getModifiers
public java.util.Set<AttributeModifier> getModifiers(AttributeModifier.Operation p_225504_1_)
-
getModifiers
public java.util.Set<AttributeModifier> getModifiers()
-
getModifier
@Nullable public AttributeModifier getModifier(java.util.UUID p_111127_1_)
-
hasModifier
public boolean hasModifier(AttributeModifier p_180374_1_)
-
addModifier
private void addModifier(AttributeModifier p_111121_1_)
-
addTransientModifier
public void addTransientModifier(AttributeModifier p_233767_1_)
-
addPermanentModifier
public void addPermanentModifier(AttributeModifier p_233769_1_)
-
setDirty
protected void setDirty()
-
removeModifier
public void removeModifier(AttributeModifier p_111124_1_)
-
removeModifier
public void removeModifier(java.util.UUID p_188479_1_)
-
removePermanentModifier
public boolean removePermanentModifier(java.util.UUID p_233770_1_)
-
removeModifiers
public void removeModifiers()
-
getValue
public double getValue()
-
calculateValue
private double calculateValue()
-
getModifiersOrEmpty
private java.util.Collection<AttributeModifier> getModifiersOrEmpty(AttributeModifier.Operation p_220370_1_)
-
replaceFrom
public void replaceFrom(ModifiableAttributeInstance p_233763_1_)
-
save
public CompoundNBT save()
-
load
public void load(CompoundNBT p_233765_1_)
-
-