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()voidfromNBT(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.CompoundTagtoNBT(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: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.
-
toNBT
Description copied from interface:IAspectPropertiesConvert the data to an NBT tag.- Specified by:
toNBTin interfaceIAspectProperties- Returns:
- The NBT tag.
-
fromNBT
public void fromNBT(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.nbt.CompoundTag tag) Description copied from interface:IAspectPropertiesRead 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:
fromNBTin interfaceIAspectProperties- Parameters:
valueDeseralizationContext- The deserialization context.tag- The tag to read from.
-
clone
- Specified by:
clonein interfaceIAspectProperties- Overrides:
clonein classObject- Returns:
- A deep copy of the properties.
-