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()
void
deserialize
(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.void
serialize
(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:IAspectProperties
Use this with caution! Better to useIAspect.getPropertyTypes()
instead because this object might hold deprecated elements.- Specified by:
getTypes
in interfaceIAspectProperties
- 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 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:IAspectProperties
Set the value for the given type.- Specified by:
setValue
in 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:IAspectProperties
Remove the value of the given type.- Specified by:
removeValue
in 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:IAspectProperties
Serialize the data.- Specified by:
serialize
in interfaceIAspectProperties
- 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 interfaceIAspectProperties
- Parameters:
valueInput
- The value input.
-
clone
- Specified by:
clone
in interfaceIAspectProperties
- Overrides:
clone
in classObject
- Returns:
- A deep copy of the properties.
-