Class AspectProperties

java.lang.Object
org.cyclops.integrateddynamics.core.part.aspect.property.AspectProperties
All Implemented Interfaces:
IAspectProperties

public class AspectProperties extends Object implements IAspectProperties
A property that can be used inside aspects.
  • Constructor Details

    • AspectProperties

      public AspectProperties(Collection<IAspectPropertyTypeInstance> propertyTypes)
      Make a new instance.
      Parameters:
      propertyTypes - The types these properties will have. These will be used to initialize the default values.
    • AspectProperties

      public AspectProperties()
      Only called for NBT serialization
  • Method Details

    • getTypes

      Deprecated.
      Description copied from interface: IAspectProperties
      Use this with caution! Better to use IAspect.getPropertyTypes() instead because this object might hold deprecated elements.
      Specified by:
      getTypes in interface IAspectProperties
      Returns:
      The types.
    • getValue

      public <T extends IValueType<V>, V extends IValue> V getValue(IAspectPropertyTypeInstance<T,V> type)
      Description copied from interface: IAspectProperties
      Get the value of the given type.
      Specified by:
      getValue in interface IAspectProperties
      Type Parameters:
      T - The value type type.
      V - The value type.
      Parameters:
      type - The type to get the value from.
      Returns:
      The value.
    • setValue

      public <T extends IValueType<V>, V extends IValue> void setValue(IAspectPropertyTypeInstance<T,V> type, V value)
      Description copied from interface: IAspectProperties
      Set the value for the given type.
      Specified by:
      setValue in interface IAspectProperties
      Type Parameters:
      T - The value type type.
      V - The value type.
      Parameters:
      type - The type to get the value from.
      value - The value.
    • removeValue

      public <T extends IValueType<V>, V extends IValue> void removeValue(IAspectPropertyTypeInstance<T,V> type)
      Description copied from interface: IAspectProperties
      Remove the value of the given type.
      Specified by:
      removeValue in interface IAspectProperties
      Type Parameters:
      T - The value type type.
      V - The value type.
      Parameters:
      type - The type to get the value from.
    • serialize

      public void serialize(net.minecraft.world.level.storage.ValueOutput valueOutput)
      Description copied from interface: IAspectProperties
      Serialize the data.
      Specified by:
      serialize in interface IAspectProperties
      Parameters:
      valueOutput - The value output.
    • deserialize

      public void deserialize(net.minecraft.world.level.storage.ValueInput valueInput)
      Description copied from interface: IAspectProperties
      Read the data and place it in this object. The given tag will never be null, so make sure that all fields have a correct default value in case the received tag would be null anyways.
      Specified by:
      deserialize in interface IAspectProperties
      Parameters:
      valueInput - The value input.
    • resetInvalidValues

      public static void resetInvalidValues(IAspectProperties properties, IAspectProperties defaultProperties)
      Reset values that do not pass their property validator to the default value.
      Parameters:
      properties - The properties to check.
      defaultProperties - The default properties, which hold the property validators.
    • clone

      public IAspectProperties clone()
      Specified by:
      clone in interface IAspectProperties
      Overrides:
      clone in class Object
      Returns:
      A deep copy of the properties.