Class SlimePropertyMap

java.lang.Object
com.infernalsuite.asp.api.world.properties.SlimePropertyMap

public class SlimePropertyMap extends Object
A Property Map object.
  • Constructor Details

    • SlimePropertyMap

      public SlimePropertyMap()
    • SlimePropertyMap

      public SlimePropertyMap(Map<String,net.kyori.adventure.nbt.BinaryTag> properties)
  • Method Details

    • getValue

      public <T, Z extends net.kyori.adventure.nbt.BinaryTag> T getValue(SlimeProperty<T,Z> property)
      Return the current value of the given property
      Parameters:
      property - The slime property
      Returns:
      The current value
    • getProperties

      public Map<String,net.kyori.adventure.nbt.BinaryTag> 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 property
      value - The new value
      Throws:
      IllegalArgumentException - if the value fails validation.
    • merge

      public void merge(SlimePropertyMap other)
      Copies all values from the specified SlimePropertyMap. If the same property has different values on both maps, the one on the provided map will be used.
      Parameters:
      other - A SlimePropertyMap.
    • toCompound

      public net.kyori.adventure.nbt.CompoundBinaryTag toCompound()
      Returns a CompoundBinaryTag containing every property set in this map.
      Returns:
      A CompoundBinaryTag with all the properties stored in this map.
    • fromCompound

      public static SlimePropertyMap fromCompound(net.kyori.adventure.nbt.CompoundBinaryTag tag)
    • clone

      public SlimePropertyMap clone()
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object