Class SlimePropertyMap
java.lang.Object
com.infernalsuite.asp.api.world.properties.SlimePropertyMap
A Property Map object.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
static SlimePropertyMap
fromCompound
(net.kyori.adventure.nbt.CompoundBinaryTag tag) Return the properties (CompoundMap)<T,
Z extends net.kyori.adventure.nbt.BinaryTag>
TgetValue
(SlimeProperty<T, Z> property) Return the current value of the given propertyvoid
merge
(SlimePropertyMap other) Copies all values from the specifiedSlimePropertyMap
.<T,
Z extends net.kyori.adventure.nbt.BinaryTag>
voidsetValue
(SlimeProperty<T, Z> property, T value) Update the value of the given propertynet.kyori.adventure.nbt.CompoundBinaryTag
Returns aCompoundBinaryTag
containing every property set in this map.toString()
-
Constructor Details
-
SlimePropertyMap
public SlimePropertyMap() -
SlimePropertyMap
-
-
Method Details
-
getValue
Return the current value of the given property- Parameters:
property
- The slime property- Returns:
- The current value
-
getProperties
Return the properties (CompoundMap)- Returns:
- The properties
-
setValue
public <T,Z extends net.kyori.adventure.nbt.BinaryTag> void setValue(SlimeProperty<T, Z> property, T value) Update the value of the given property- Parameters:
property
- The slime propertyvalue
- The new value- Throws:
IllegalArgumentException
- if the value fails validation.
-
merge
Copies all values from the specifiedSlimePropertyMap
. If the same property has different values on both maps, the one on the provided map will be used.- Parameters:
other
- ASlimePropertyMap
.
-
toCompound
public net.kyori.adventure.nbt.CompoundBinaryTag toCompound()Returns aCompoundBinaryTag
containing every property set in this map.- Returns:
- A
CompoundBinaryTag
with all the properties stored in this map.
-
fromCompound
-
clone
-
toString
-