Class SlimePropertyMap

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

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

    • SlimePropertyMap

      public SlimePropertyMap(com.flowpowered.nbt.CompoundMap compoundMap)
    • SlimePropertyMap

      public SlimePropertyMap()
  • Method Details

    • getValue

      public <T> T getValue(SlimeProperty<T> property)
      Return the current value of the given property
      Parameters:
      property - The slime property
      Returns:
      The current value
    • getProperties

      public com.flowpowered.nbt.CompoundMap getProperties()
      Return the properties (CompoundMap)
      Returns:
      The properties
    • setValue

      public <T> void setValue(SlimeProperty<T> 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 propertyMap)
      Copies all values from the specified SlimePropertyMap. If the same property has different values on both maps, the one on the providen map will be used.
      Parameters:
      propertyMap - A SlimePropertyMap.
    • toCompound

      public com.flowpowered.nbt.CompoundTag toCompound()
      Returns a CompoundTag containing every property set in this map.
      Returns:
      A CompoundTag with all the properties stored in this map.
    • fromCompound

      public static SlimePropertyMap fromCompound(com.flowpowered.nbt.CompoundTag compound)
    • clone

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

      public String toString()
      Overrides:
      toString in class Object