Class AspectReadBase<V extends IValue,T extends IValueType<V>>
java.lang.Object
org.cyclops.integrateddynamics.part.aspect.AspectBase<V,T>
org.cyclops.integrateddynamics.part.aspect.read.AspectReadBase<V,T>
- All Implemented Interfaces:
IAspect<V,
,T> IAspectRead<V,
T>
public abstract class AspectReadBase<V extends IValue,T extends IValueType<V>>
extends AspectBase<V,T>
implements IAspectRead<V,T>
Base class for read aspects.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.cyclops.integrateddynamics.api.part.aspect.IAspect
IAspect.AspectComparator
-
Constructor Summary
ConstructorDescriptionAspectReadBase
(org.cyclops.cyclopscore.init.ModBase mod, String unlocalizedTypeSuffix, IAspectProperties defaultProperties, AspectUpdateType updateType) -
Method Summary
Modifier and TypeMethodDescriptioncreateNewVariable
(Supplier<PartTarget> target) Creates a new variable for this aspect.protected String
protected abstract V
getValue
(PartTarget target, IAspectProperties properties) This is only called lazy.protected void
<P extends IPartType<P,
S>, S extends IPartState<P>>
voidupdate
(INetwork network, IPartNetwork partNetwork, P partType, PartTarget target, S state) Called inside part types for updating a part on a block.Methods inherited from class org.cyclops.integrateddynamics.part.aspect.AspectBase
createDefaultProperties, getDefaultProperties, getMod, getModId, getProperties, getPropertiesContainerProvider, getPropertyTypes, getTranslationKey, getUniqueName, getUnlocalizedPrefix, hasProperties, loadTooltip, setProperties
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cyclops.integrateddynamics.api.part.aspect.IAspect
getDefaultProperties, getProperties, getPropertiesContainerProvider, getPropertyTypes, getTranslationKey, getUniqueName, getValueType, hasProperties, loadTooltip, setProperties
Methods inherited from interface org.cyclops.integrateddynamics.api.part.aspect.IAspectRead
createNewVariable
-
Constructor Details
-
AspectReadBase
public AspectReadBase(org.cyclops.cyclopscore.init.ModBase mod, String unlocalizedTypeSuffix, IAspectProperties defaultProperties, AspectUpdateType updateType)
-
-
Method Details
-
update
public <P extends IPartType<P,S>, void updateS extends IPartState<P>> (INetwork network, IPartNetwork partNetwork, P partType, PartTarget target, S state) Description copied from interface:IAspect
Called inside part types for updating a part on a block.- Specified by:
update
in interfaceIAspect<V extends IValue,
T extends IValueType<V>> - Type Parameters:
P
- The part type type.S
- The part state.- Parameters:
network
- The network to update in.partNetwork
- The part network to update in.partType
- The part type.target
- The position that is targeted by the given part.state
- The current state of the given part.
-
getUnlocalizedType
- Specified by:
getUnlocalizedType
in classAspectBase<V extends IValue,
T extends IValueType<V>>
-
registerModelResourceLocation
protected void registerModelResourceLocation() -
getValue
protected abstract V getValue(PartTarget target, IAspectProperties properties) throws EvaluationException This is only called lazy.- Parameters:
target
- The target to get the value for.properties
- The optional properties for this aspect.- Returns:
- The value that will be inserted into a variable so it can be used elsewhere.
- Throws:
EvaluationException
- If evaluation has gone wrong.
-
createNewVariable
Description copied from interface:IAspectRead
Creates a new variable for this aspect.- Specified by:
createNewVariable
in interfaceIAspectRead<V extends IValue,
T extends IValueType<V>> - Parameters:
target
- The target supplier for this aspect.- Returns:
- The variable pointing to the given target.
-
getUpdateType
- Specified by:
getUpdateType
in interfaceIAspectRead<V extends IValue,
T extends IValueType<V>> - Returns:
- The update type on which this aspect should invalidate.
-