Interface IPartStateReader<P extends IPartTypeReader>
- All Superinterfaces:
IPartState<P>
- All Known Implementing Classes:
PartStateReaderBase
A value holder for an
IPartTypeReader
.
This is what will be serialized from and to NBT.
This object is mutable and should not be recreated.-
Field Summary
Fields inherited from interface org.cyclops.integrateddynamics.api.part.IPartState
GLOBALCOUNTER_KEY
-
Method Summary
Modifier and TypeMethodDescription<V extends IValue,
T extends IValueType<V>>
IAspectVariable<V>getVariable
(IAspectRead<V, T> aspect) Get the singleton variable for an aspect.void
Reset all cached aspect variables.void
setVariable
(IAspect aspect, IAspectVariable variable) Get the singleton variable for an aspect.Methods inherited from interface org.cyclops.integrateddynamics.api.part.IPartState
addVolatileCapability, clearInventoriesNamed, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getCapability, getChannel, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, initializeOffsets, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, loadInventoryNamed, markDirty, markOffsetVariablesChanged, readFromNBT, removeVolatileCapability, requiresOffsetUpdates, saveInventoryNamed, setAspectProperties, setChannel, setEnabled, setInventoryNamed, setMaxOffset, setPriority, setTargetOffset, setTargetSideOverride, setUpdateInterval, updateOffsetVariables, writeToNBT
-
Method Details
-
getVariable
Get the singleton variable for an aspect. This only retrieves the previously stored state. Better to callIPartTypeReader.getVariable(PartTarget, IPartStateReader, IAspectRead)
.- Type Parameters:
V
- The value typeT
- The value type type- Parameters:
aspect
- The aspect from the part of this state.- Returns:
- The variable that exists only once for an aspect in this part state.
-
setVariable
Get the singleton variable for an aspect.- Parameters:
aspect
- The aspect from the part of this state.variable
- The variable that exists only once for an aspect in this part state.
-
resetVariables
void resetVariables()Reset all cached aspect variables.
-