public class AttributeContainer extends Object
Modifier and Type | Field and Description |
---|---|
private Map<EntityAttribute,EntityAttributeInstance> |
custom |
private DefaultAttributeContainer |
fallback |
private static Logger |
LOGGER |
private Set<EntityAttributeInstance> |
tracked |
Constructor and Description |
---|
AttributeContainer(DefaultAttributeContainer defaultAttributes) |
Modifier and Type | Method and Description |
---|---|
void |
addTemporaryModifiers(Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers) |
void |
fromTag(ListTag tag) |
Collection<EntityAttributeInstance> |
getAttributesToSend() |
double |
getBaseValue(EntityAttribute attribute) |
EntityAttributeInstance |
getCustomInstance(EntityAttribute attribute) |
double |
getModifierValue(EntityAttribute attribute,
UUID uuid) |
Set<EntityAttributeInstance> |
getTracked() |
double |
getValue(EntityAttribute attribute) |
boolean |
hasAttribute(EntityAttribute attribute) |
boolean |
hasModifierForAttribute(EntityAttribute attribute,
UUID uuid) |
void |
removeModifiers(Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers) |
void |
setFrom(AttributeContainer other) |
ListTag |
toTag() |
private void |
updateTrackedStatus(EntityAttributeInstance instance) |
private static final Logger LOGGER
private final Map<EntityAttribute,EntityAttributeInstance> custom
private final Set<EntityAttributeInstance> tracked
private final DefaultAttributeContainer fallback
public AttributeContainer(DefaultAttributeContainer defaultAttributes)
private void updateTrackedStatus(EntityAttributeInstance instance)
public Set<EntityAttributeInstance> getTracked()
public Collection<EntityAttributeInstance> getAttributesToSend()
@Nullable public EntityAttributeInstance getCustomInstance(EntityAttribute attribute)
public boolean hasAttribute(EntityAttribute attribute)
public boolean hasModifierForAttribute(EntityAttribute attribute, UUID uuid)
public double getValue(EntityAttribute attribute)
public double getBaseValue(EntityAttribute attribute)
public double getModifierValue(EntityAttribute attribute, UUID uuid)
public void removeModifiers(Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers)
public void addTemporaryModifiers(Multimap<EntityAttribute,EntityAttributeModifier> attributeModifiers)
@Environment(value=CLIENT) public void setFrom(AttributeContainer other)
public ListTag toTag()
public void fromTag(ListTag tag)