Class AspectProperties
java.lang.Object
org.cyclops.integrateddynamics.core.part.aspect.property.AspectProperties
- All Implemented Interfaces:
org.cyclops.cyclopscore.persist.nbt.INBTSerializable
,IAspectProperties
A property that can be used inside aspects.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cyclops.cyclopscore.persist.nbt.INBTSerializable
org.cyclops.cyclopscore.persist.nbt.INBTSerializable.SelfNBTClassType
-
Constructor Summary
ConstructorsConstructorDescriptionOnly called for NBT serializationAspectProperties
(Collection<IAspectPropertyTypeInstance> propertyTypes) Make a new instance. -
Method Summary
Modifier and TypeMethodDescriptionclone()
void
fromNBT
(net.minecraft.nbt.CompoundTag tag) 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()
-
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
public net.minecraft.nbt.CompoundTag toNBT()- Specified by:
toNBT
in interfaceorg.cyclops.cyclopscore.persist.nbt.INBTSerializable
-
fromNBT
public void fromNBT(net.minecraft.nbt.CompoundTag tag) - Specified by:
fromNBT
in interfaceorg.cyclops.cyclopscore.persist.nbt.INBTSerializable
-
clone
- Specified by:
clone
in interfaceIAspectProperties
- Overrides:
clone
in classObject
- Returns:
- A deep copy of the properties.
-