Class AspectProperties
java.lang.Object
org.cyclops.integrateddynamics.core.part.aspect.property.AspectProperties
- All Implemented Interfaces:
IAspectProperties
A property that can be used inside aspects.
-
Constructor Summary
ConstructorsConstructorDescriptionOnly called for NBT serializationAspectProperties(Collection<IAspectPropertyTypeInstance> propertyTypes) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionclone()voiddeserialize(net.minecraft.world.level.storage.ValueInput valueInput) Read the data and place it in this object.getTypes()Deprecated.<T extends IValueType<V>,V extends IValue>
VgetValue(IAspectPropertyTypeInstance<T, V> type) Get the value of the given type.<T extends IValueType<V>,V extends IValue>
voidremoveValue(IAspectPropertyTypeInstance<T, V> type) Remove the value of the given type.voidserialize(net.minecraft.world.level.storage.ValueOutput valueOutput) Serialize the data.<T extends IValueType<V>,V extends IValue>
voidsetValue(IAspectPropertyTypeInstance<T, V> type, V value) Set the value for the given type.
-
Constructor Details
-
AspectProperties
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:IAspectPropertiesUse this with caution! Better to useIAspect.getPropertyTypes()instead because this object might hold deprecated elements.- Specified by:
getTypesin interfaceIAspectProperties- Returns:
- The types.
-
getValue
public <T extends IValueType<V>,V extends IValue> V getValue(IAspectPropertyTypeInstance<T, V> type) Description copied from interface:IAspectPropertiesGet the value of the given type.- Specified by:
getValuein interfaceIAspectProperties- 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:IAspectPropertiesSet the value for the given type.- Specified by:
setValuein interfaceIAspectProperties- 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:IAspectPropertiesRemove the value of the given type.- Specified by:
removeValuein interfaceIAspectProperties- 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:IAspectPropertiesSerialize the data.- Specified by:
serializein interfaceIAspectProperties- Parameters:
valueOutput- The value output.
-
deserialize
public void deserialize(net.minecraft.world.level.storage.ValueInput valueInput) Description copied from interface:IAspectPropertiesRead 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:
deserializein interfaceIAspectProperties- Parameters:
valueInput- The value input.
-
clone
- Specified by:
clonein interfaceIAspectProperties- Overrides:
clonein classObject- Returns:
- A deep copy of the properties.
-