Class PartTypePanelLightDynamic
java.lang.Object
org.cyclops.integrateddynamics.api.part.PartTypeAdapter<PartTypePanelLightDynamic,PartTypePanelLightDynamic.State>
org.cyclops.integrateddynamics.core.part.PartTypeBase<PartTypePanelLightDynamic,PartTypePanelLightDynamic.State>
org.cyclops.integrateddynamics.core.part.panel.PartTypePanel<PartTypePanelLightDynamic,PartTypePanelLightDynamic.State>
org.cyclops.integrateddynamics.core.part.panel.PartTypePanelVariableDriven<PartTypePanelLightDynamic,PartTypePanelLightDynamic.State>
org.cyclops.integrateddynamics.part.PartTypePanelLightDynamic
- All Implemented Interfaces:
INetworkEventListener<IPartNetworkElement<PartTypePanelLightDynamic,
,PartTypePanelLightDynamic.State>> IPartType<PartTypePanelLightDynamic,
,PartTypePanelLightDynamic.State> IPartTypeActiveVariable<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State>
public class PartTypePanelLightDynamic
extends PartTypePanelVariableDriven<PartTypePanelLightDynamic,PartTypePanelLightDynamic.State>
A part that can display variables.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cyclops.integrateddynamics.core.part.PartTypeBase
PartTypeBase.IEventAction<P extends IPartType<P,
S>, S extends IPartState<P>, E extends INetworkEvent> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected net.minecraft.world.level.block.Block
createBlock
(org.cyclops.cyclopscore.config.extendedconfig.BlockConfig blockConfig) Factory method for creating a block instance.int
protected int
getLightLevel
(PartTypePanelLightDynamic.State state, IValue value) protected IgnoredBlockStatus.Status
void
onBlockNeighborChange
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state, net.minecraft.world.level.BlockGetter world, net.minecraft.world.level.block.Block neighbourBlock, net.minecraft.core.BlockPos neighbourPos) Called when a neighbouring block is updated, more specifically whenBlockBehaviour.neighborChanged(BlockState, Level, BlockPos, Block, BlockPos, boolean)
,IBlockExtension.onNeighborChange(BlockState, LevelReader, BlockPos, BlockPos)
orBlockBehaviour.updateShape(BlockState, Direction, BlockState, LevelAccessor, BlockPos, BlockPos)
is called.void
onNetworkRemoval
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state) Called when this element is removed from the network.void
onPostRemoved
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state) Called after this element has been removed.protected void
onValueChanged
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state, IValue lastValue, IValue newValue) void
postUpdate
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state, boolean updated) Called after the element was updated or not.static void
setLightLevel
(PartTarget target, int lightLevel) boolean
Methods inherited from class org.cyclops.integrateddynamics.core.part.panel.PartTypePanelVariableDriven
addDrops, afterNetworkAlive, beforeNetworkKill, constructNetworkEventActions, getActiveVariable, getBlockState, getContainerProvider, hasActiveVariable, isUpdate, loadTooltip, onPartActivated, onVariableContentsUpdated, shouldTriggerBlockRenderUpdate, update, writeExtraGuiData
Methods inherited from class org.cyclops.integrateddynamics.core.part.PartTypeBase
createItem, createNetworkElement, createTranslationKey, forceLightTransparency, getBaseBlockState, getBlockModelPath, getMod, getSubscribedEvents, getUniqueName, hasEventSubscriptions, loadTooltip, onEvent, registerBlock
Methods inherited from class org.cyclops.integrateddynamics.api.part.PartTypeAdapter
afterNetworkReAlive, defaultBlockState, fromNBT, getChannel, getCloneItemStack, getItemStack, getMinimumUpdateInterval, getPriority, getState, getTarget, getTargetOffset, getTargetSideOverride, getTranslationKey, getUpdateInterval, hasOffsetVariables, isEnabled, isSolid, onNetworkAddition, onOffsetVariablesChanged, onPreRemoved, setEnabled, setPriorityAndChannel, setTargetOffset, setTargetSideOverride, setUpdateInterval, toNBT, updateTick
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.network.INetworkEventListener
getSubscribedEvents, hasEventSubscriptions, onEvent
Methods inherited from interface org.cyclops.integrateddynamics.api.part.IPartType
afterNetworkReAlive, createNetworkElement, defaultBlockState, forceLightTransparency, fromNBT, getBaseBlockState, getBlockModelPath, getChannel, getCloneItemStack, getContainerProviderOffsets, getContainerProviderSettings, getItem, getItemStack, getMinimumUpdateInterval, getPartRenderPosition, getPriority, getState, getTarget, getTargetOffset, getTargetSideOverride, getTranslationKey, getUniqueName, getUpdateInterval, isEnabled, isSolid, loadTooltip, onNetworkAddition, onOffsetVariablesChanged, onPreRemoved, setEnabled, setPriorityAndChannel, setTargetOffset, setTargetSideOverride, setUpdateInterval, toNBT, updateTick, writeExtraGuiDataOffsets, writeExtraGuiDataSettings
-
Constructor Details
-
PartTypePanelLightDynamic
-
-
Method Details
-
supportsOffsets
public boolean supportsOffsets()- Returns:
- If this part can handle custom offsets.
-
createBlock
protected net.minecraft.world.level.block.Block createBlock(org.cyclops.cyclopscore.config.extendedconfig.BlockConfig blockConfig) Description copied from class:PartTypeBase
Factory method for creating a block instance.- Overrides:
createBlock
in classPartTypePanelVariableDriven<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Parameters:
blockConfig
- The config to register the block for.- Returns:
- The block instance.
-
constructDefaultState
- Specified by:
constructDefaultState
in classPartTypeAdapter<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Returns:
- Constructor call for a new default state for this part type.
-
getConsumptionRate
- Specified by:
getConsumptionRate
in interfaceIPartType<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Overrides:
getConsumptionRate
in classPartTypeAdapter<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Parameters:
state
- The state- Returns:
- The consumption rate of this part for the given state.
-
getStatus
- Overrides:
getStatus
in classPartTypePanelVariableDriven<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State>
-
onValueChanged
protected void onValueChanged(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state, IValue lastValue, IValue newValue) -
getLightLevel
-
onNetworkRemoval
public void onNetworkRemoval(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state) Description copied from interface:IPartType
Called when this element is removed from the network.- Specified by:
onNetworkRemoval
in interfaceIPartType<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Overrides:
onNetworkRemoval
in classPartTypeAdapter<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Parameters:
network
- The network to update in.partNetwork
- The part network to update in.target
- The target block.state
- The state
-
onPostRemoved
public void onPostRemoved(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state) Description copied from interface:IPartType
Called after this element has been removed.- Specified by:
onPostRemoved
in interfaceIPartType<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Overrides:
onPostRemoved
in classPartTypeAdapter<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Parameters:
network
- The network.partNetwork
- The part network to update in.target
- The target block.state
- The state
-
onBlockNeighborChange
public void onBlockNeighborChange(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state, net.minecraft.world.level.BlockGetter world, net.minecraft.world.level.block.Block neighbourBlock, net.minecraft.core.BlockPos neighbourPos) Description copied from interface:IPartType
Called when a neighbouring block is updated, more specifically whenBlockBehaviour.neighborChanged(BlockState, Level, BlockPos, Block, BlockPos, boolean)
,IBlockExtension.onNeighborChange(BlockState, LevelReader, BlockPos, BlockPos)
orBlockBehaviour.updateShape(BlockState, Direction, BlockState, LevelAccessor, BlockPos, BlockPos)
is called.- Specified by:
onBlockNeighborChange
in interfaceIPartType<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Overrides:
onBlockNeighborChange
in classPartTypeAdapter<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Parameters:
network
- The network to update in.partNetwork
- The part network to update in.target
- The target block.state
- The stateworld
- The world in which the neighbour was updated.neighbourBlock
- The block type of the neighbour that was updated.neighbourPos
- The position of the neighbour that was updated.
-
postUpdate
public void postUpdate(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypePanelLightDynamic.State state, boolean updated) Description copied from interface:IPartType
Called after the element was updated or not. If the update was not called, this can be because the network did not contain enough energy to let this element work.- Specified by:
postUpdate
in interfaceIPartType<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Overrides:
postUpdate
in classPartTypeAdapter<PartTypePanelLightDynamic,
PartTypePanelLightDynamic.State> - Parameters:
network
- The network to update in.partNetwork
- The part network to update in.target
- The target block.state
- The stateupdated
- If theINetworkElement.update(INetwork)
was called.
-
setLightLevel
-