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
ConstructorDescriptionOnly called for NBT serializationAspectProperties
(Collection<IAspectPropertyTypeInstance> propertyTypes) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
fromNBT
(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.CompoundTag tag) Read the data from an NBT tag 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.<T extends IValueType<V>,
V extends IValue>
voidsetValue
(IAspectPropertyTypeInstance<T, V> type, V value) Set the value for the given type.net.minecraft.nbt.CompoundTag
toNBT
(ValueDeseralizationContext valueDeseralizationContext) Convert the data to an NBT tag.
-
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.
-
toNBT
Description copied from interface:IAspectProperties
Convert the data to an NBT tag.- Specified by:
toNBT
in interfaceIAspectProperties
- Returns:
- The NBT tag.
-
fromNBT
public void fromNBT(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.CompoundTag tag) Description copied from interface:IAspectProperties
Read the data from an NBT tag 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:
fromNBT
in interfaceIAspectProperties
- Parameters:
valueDeseralizationContext
- The deserialization context.tag
- The tag to read from.
-
clone
- Specified by:
clone
in interfaceIAspectProperties
- Overrides:
clone
in classObject
- Returns:
- A deep copy of the properties.
-