Class PartTypeConnectorMonoDirectional
java.lang.Object
org.cyclops.integrateddynamics.api.part.PartTypeAdapter<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State>
org.cyclops.integrateddynamics.core.part.PartTypeBase<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State>
org.cyclops.integrateddynamics.part.PartTypeConnector<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State>
org.cyclops.integrateddynamics.part.PartTypeConnectorMonoDirectional
- All Implemented Interfaces:
INetworkEventListener<IPartNetworkElement<PartTypeConnectorMonoDirectional,
,PartTypeConnectorMonoDirectional.State>> IPartType<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State>
public class PartTypeConnectorMonoDirectional
extends PartTypeConnector<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State>
A monodirectional wireless connector part that can connect to
at most one other monodirectional connector in a straight line.
-
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 int
findTargetOffset
(PartPos origin) Look in the part's direction for an unbound monodirectional connector.net.minecraft.world.level.block.state.BlockState
getBlockState
(IPartContainer partContainer, net.minecraft.core.Direction side) Get the base block state that will be rendered for this part.int
net.minecraft.world.item.ItemStack
getItemStack
(ValueDeseralizationContext valueDeseralizationContext, PartTypeConnectorMonoDirectional.State state, boolean saveState) Get the itemstack from the given state.protected IgnoredBlockStatus.Status
void
onNetworkAddition
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypeConnectorMonoDirectional.State state) Called when this element is added to the network.void
onPostRemoved
(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypeConnectorMonoDirectional.State state) Called after this element has been removed.Methods inherited from class org.cyclops.integrateddynamics.part.PartTypeConnector
afterNetworkReAlive, createBlock, supportsOffsets
Methods inherited from class org.cyclops.integrateddynamics.core.part.PartTypeBase
addDrops, constructNetworkEventActions, createItem, createNetworkElement, createTranslationKey, forceLightTransparency, getBaseBlockState, getBlockModelPath, getMod, getSubscribedEvents, getUniqueName, hasEventSubscriptions, loadTooltip, loadTooltip, onEvent, onPartActivated, registerBlock, writeExtraGuiData
Methods inherited from class org.cyclops.integrateddynamics.api.part.PartTypeAdapter
afterNetworkAlive, beforeNetworkKill, defaultBlockState, fromNBT, getChannel, getCloneItemStack, getMinimumUpdateInterval, getPriority, getState, getTarget, getTargetOffset, getTargetSideOverride, getTranslationKey, getUpdateInterval, hasOffsetVariables, isEnabled, isSolid, isUpdate, onBlockNeighborChange, onNetworkRemoval, onOffsetVariablesChanged, onPreRemoved, postUpdate, setEnabled, setPriorityAndChannel, setTargetOffset, setTargetSideOverride, setUpdateInterval, shouldTriggerBlockRenderUpdate, toNBT, update, 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.part.IPartType
getContainerProvider, getContainerProviderOffsets, getContainerProviderSettings, getItem, getPartRenderPosition, writeExtraGuiDataOffsets, writeExtraGuiDataSettings
-
Constructor Details
-
PartTypeConnectorMonoDirectional
-
-
Method Details
-
getConsumptionRate
- Specified by:
getConsumptionRate
in interfaceIPartType<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Overrides:
getConsumptionRate
in classPartTypeAdapter<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Parameters:
state
- The state- Returns:
- The consumption rate of this part for the given state.
-
constructDefaultState
- Specified by:
constructDefaultState
in classPartTypeAdapter<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Returns:
- Constructor call for a new default state for this part type.
-
onNetworkAddition
public void onNetworkAddition(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypeConnectorMonoDirectional.State state) Description copied from interface:IPartType
Called when this element is added to the network.- Specified by:
onNetworkAddition
in interfaceIPartType<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Overrides:
onNetworkAddition
in classPartTypeConnector<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.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, PartTypeConnectorMonoDirectional.State state) Description copied from interface:IPartType
Called after this element has been removed.- Specified by:
onPostRemoved
in interfaceIPartType<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Overrides:
onPostRemoved
in classPartTypeAdapter<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Parameters:
network
- The network.partNetwork
- The part network to update in.target
- The target block.state
- The state
-
getItemStack
public net.minecraft.world.item.ItemStack getItemStack(ValueDeseralizationContext valueDeseralizationContext, PartTypeConnectorMonoDirectional.State state, boolean saveState) Description copied from interface:IPartType
Get the itemstack from the given state.- Specified by:
getItemStack
in interfaceIPartType<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Overrides:
getItemStack
in classPartTypeAdapter<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Parameters:
valueDeseralizationContext
-state
- The statesaveState
- If the part state should be saved in the item.- Returns:
- The itemstack possibly containing the state information.
-
findTargetOffset
Look in the part's direction for an unbound monodirectional connector.- Parameters:
origin
- The origin position to start looking from.- Returns:
- The other connector's distance, or 0 if not found.
-
getStatus
-
getBlockState
public net.minecraft.world.level.block.state.BlockState getBlockState(IPartContainer partContainer, net.minecraft.core.Direction side) Description copied from interface:IPartType
Get the base block state that will be rendered for this part. An appropriateIgnoredBlock.FACING
property will be set.- Specified by:
getBlockState
in interfaceIPartType<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Overrides:
getBlockState
in classPartTypeBase<PartTypeConnectorMonoDirectional,
PartTypeConnectorMonoDirectional.State> - Parameters:
partContainer
- The part entity.side
- The position of the part.- Returns:
- The block state to render with.
-