Class PartStateWriterBase<P extends IPartTypeWriter>
java.lang.Object
org.cyclops.integrateddynamics.core.part.PartStateBase<P>
org.cyclops.integrateddynamics.core.part.PartStateActiveVariableBase<P>
org.cyclops.integrateddynamics.core.part.write.PartStateWriterBase<P>
- All Implemented Interfaces:
- org.cyclops.cyclopscore.persist.IDirtyMarkListener,- IPartState<P>,- IPartStateWriter<P>
public class PartStateWriterBase<P extends IPartTypeWriter>
extends PartStateActiveVariableBase<P>
implements IPartStateWriter<P>
A default implementation of the 
IPartTypeWriter.- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class org.cyclops.integrateddynamics.core.part.PartStateActiveVariableBasePartStateActiveVariableBase.SingularInventory
- 
Field SummaryFields inherited from class org.cyclops.integrateddynamics.core.part.PartStateActiveVariableBasecurrentVariableFacadeFields inherited from interface org.cyclops.integrateddynamics.api.part.IPartStateGLOBALCOUNTER_KEY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddError(IAspectWrite aspect, net.minecraft.network.chat.MutableComponent error) Set the current error for the given aspect.booleanIf this state is at its first tick, will be reset after calling this.voiddeserialize(net.minecraft.world.level.storage.ValueInput valueInput) Read a state from NBT.List<net.minecraft.network.chat.Component> getErrors(IAspectWrite aspect) Get the current error for the given aspect.booleanprotected voidvoidonVariableContentsUpdated(P partType, PartTarget target) Refresh the current variable to have its current info reset and updated.voidserialize(net.minecraft.world.level.storage.ValueOutput valueOutput) Write a state to NBT.voidtriggerAspectInfoUpdate(P partType, PartTarget target, IAspectWrite newAspect, boolean isNetworkInitializing) Indicate that this state should eventually recheck its aspect info because something might have changed what can cause the active variable to be referring to something else.protected voidvalidate(INetwork network, IPartNetwork partNetwork) Methods inherited from class org.cyclops.integrateddynamics.core.part.PartStateActiveVariableBaseaddGlobalError, getCapability, getGlobalErrors, getInventory, getVariableMethods inherited from class org.cyclops.integrateddynamics.core.part.PartStateBaseaddVolatileCapability, clearInventoriesNamed, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getChannel, getDefaultUpdateInterval, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, initializeOffsets, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, markDirty, markOffsetVariablesChanged, onDirty, readAspectProperties, removeVolatileCapability, requiresOffsetUpdates, sendUpdate, setAspectProperties, setChannel, setEnabled, setInventoryNamed, setMaxOffset, setPriority, setTargetOffset, setTargetSideOverride, setUpdateInterval, updateOffsetVariables, writeAspectPropertiesMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.part.IPartStateaddVolatileCapability, clearInventoriesNamed, forceBlockRenderUpdate, gatherCapabilities, generateId, getAspectProperties, getCapability, getChannel, getId, getInventoriesNamed, getInventoryNamed, getMaxOffset, getOffsetVariableError, getPriority, getTargetOffset, getTargetSideOverride, getUpdateInterval, initializeOffsets, isDirtyAndReset, isEnabled, isForceBlockRenderUpdateAndReset, isUpdateAndReset, loadInventoryNamed, markDirty, markOffsetVariablesChanged, removeVolatileCapability, requiresOffsetUpdates, saveInventoryNamed, setAspectProperties, setChannel, setEnabled, setInventoryNamed, setMaxOffset, setPriority, setTargetOffset, setTargetSideOverride, setUpdateInterval, updateOffsetVariablesMethods inherited from interface org.cyclops.integrateddynamics.api.part.write.IPartStateWritergetInventory, getVariable, isDeactivated, setDeactivated
- 
Constructor Details- 
PartStateWriterBasepublic PartStateWriterBase(int inventorySize) 
 
- 
- 
Method Details- 
serializepublic void serialize(net.minecraft.world.level.storage.ValueOutput valueOutput) Description copied from interface:IPartStateWrite a state to NBT.- Specified by:
- serializein interface- IPartState<P extends IPartTypeWriter>
- Overrides:
- serializein class- PartStateActiveVariableBase<P extends IPartTypeWriter>
- Parameters:
- valueOutput- The value to write to.
 
- 
deserializepublic void deserialize(net.minecraft.world.level.storage.ValueInput valueInput) Description copied from interface:IPartStateRead a state from NBT.- Specified by:
- deserializein interface- IPartState<P extends IPartTypeWriter>
- Overrides:
- deserializein class- PartStateActiveVariableBase<P extends IPartTypeWriter>
- Parameters:
- valueInput- The value to read from.
 
- 
validate- Overrides:
- validatein class- PartStateActiveVariableBase<P extends IPartTypeWriter>
 
- 
onCorruptedStateprotected void onCorruptedState()- Overrides:
- onCorruptedStatein class- PartStateActiveVariableBase<P extends IPartTypeWriter>
 
- 
hasVariablepublic boolean hasVariable()- Specified by:
- hasVariablein interface- IPartStateWriter<P extends IPartTypeWriter>
- Overrides:
- hasVariablein class- PartStateActiveVariableBase<P extends IPartTypeWriter>
- Returns:
- If there is an active variable present for this state.
 
- 
triggerAspectInfoUpdatepublic void triggerAspectInfoUpdate(P partType, PartTarget target, IAspectWrite newAspect, boolean isNetworkInitializing) Description copied from interface:IPartStateWriterIndicate that this state should eventually recheck its aspect info because something might have changed what can cause the active variable to be referring to something else.- Specified by:
- triggerAspectInfoUpdatein interface- IPartStateWriter<P extends IPartTypeWriter>
- Parameters:
- partType- The part type.
- target- The target.
- newAspect- The new active aspect, can be null.
- isNetworkInitializing- If this method is being invoked during network (de)initializing.
 
- 
onVariableContentsUpdatedDescription copied from class:PartStateActiveVariableBaseRefresh the current variable to have its current info reset and updated.- Specified by:
- onVariableContentsUpdatedin interface- IPartStateWriter<P extends IPartTypeWriter>
- Overrides:
- onVariableContentsUpdatedin class- PartStateActiveVariableBase<P extends IPartTypeWriter>
- Parameters:
- partType- The corresponding part type.
- target- The target of the part.
 
- 
getActiveAspect- Specified by:
- getActiveAspectin interface- IPartStateWriter<P extends IPartTypeWriter>
- Returns:
- The currently active aspect for this part, can be null.
 
- 
getErrorsDescription copied from interface:IPartStateWriterGet the current error for the given aspect.- Specified by:
- getErrorsin interface- IPartStateWriter<P extends IPartTypeWriter>
- Parameters:
- aspect- The aspect to get the error from.
- Returns:
- The current error, can be empty.
 
- 
addErrorDescription copied from interface:IPartStateWriterSet the current error for the given aspect.- Specified by:
- addErrorin interface- IPartStateWriter<P extends IPartTypeWriter>
- Parameters:
- aspect- The aspect to set the error for.
- error- The error to set, or null to clear.
 
- 
checkAndResetFirstTickpublic boolean checkAndResetFirstTick()Description copied from interface:IPartStateWriterIf this state is at its first tick, will be reset after calling this.- Specified by:
- checkAndResetFirstTickin interface- IPartStateWriter<P extends IPartTypeWriter>
- Returns:
- If this is the first time this state is ticking.
 
 
-