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 ClassesNested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intfindTargetOffset(PartPos origin) Look in the part's direction for an unbound monodirectional connector.net.minecraft.world.level.block.state.BlockStategetBlockState(IPartContainer partContainer, net.minecraft.core.Direction side) Get the base block state that will be rendered for this part.intnet.minecraft.world.item.ItemStackgetItemStack(ValueDeseralizationContext valueDeseralizationContext, net.minecraft.util.ProblemReporter.PathElement problemPath, PartTypeConnectorMonoDirectional.State state, boolean saveState) Get the itemstack from the given state.protected IgnoredBlockStatus.StatusvoidonNetworkAddition(INetwork network, IPartNetwork partNetwork, PartTarget target, PartTypeConnectorMonoDirectional.State state) Called when this element is added to the network.voidonPostRemoved(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, supportsOffsetsMethods inherited from class org.cyclops.integrateddynamics.core.part.PartTypeBase
addDrops, constructNetworkEventActions, createItem, createNetworkElement, createTranslationKey, forceLightTransparency, getBaseBlockState, getBlockModelPath, getMod, getModId, getSubscribedEvents, getUniqueName, hasEventSubscriptions, loadTooltip, loadTooltip, onEvent, onPartActivated, registerBlock, writeExtraGuiDataMethods inherited from class org.cyclops.integrateddynamics.api.part.PartTypeAdapter
afterNetworkAlive, beforeNetworkKill, defaultBlockState, deserializeState, getChannel, getCloneItemStack, getMinimumUpdateInterval, getPriority, getState, getTarget, getTargetOffset, getTargetSideOverride, getTranslationKey, getUpdateInterval, hasOffsetVariables, isEnabled, isSolid, isUpdate, onBlockNeighborChange, onBlockNeighborChange, onNetworkRemoval, onOffsetVariablesChanged, onPreRemoved, postUpdate, serializeState, setEnabled, setPriorityAndChannel, setTargetOffset, setTargetSideOverride, setUpdateInterval, shouldTriggerBlockRenderUpdate, update, updateTickMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.cyclops.integrateddynamics.api.part.IPartType
getContainerProvider, getContainerProviderOffsets, getContainerProviderSettings, getItem, getPartRenderPosition, writeExtraGuiDataOffsets, writeExtraGuiDataSettings
-
Constructor Details
-
PartTypeConnectorMonoDirectional
-
-
Method Details
-
getConsumptionRate
- Specified by:
getConsumptionRatein interfaceIPartType<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Overrides:
getConsumptionRatein classPartTypeAdapter<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Parameters:
state- The state- Returns:
- The consumption rate of this part for the given state.
-
constructDefaultState
- Specified by:
constructDefaultStatein 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:IPartTypeCalled when this element is added to the network.- Specified by:
onNetworkAdditionin interfaceIPartType<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Overrides:
onNetworkAdditionin 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:IPartTypeCalled after this element has been removed.- Specified by:
onPostRemovedin interfaceIPartType<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Overrides:
onPostRemovedin 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, net.minecraft.util.ProblemReporter.PathElement problemPath, PartTypeConnectorMonoDirectional.State state, boolean saveState) Description copied from interface:IPartTypeGet the itemstack from the given state.- Specified by:
getItemStackin interfaceIPartType<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Overrides:
getItemStackin classPartTypeAdapter<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Parameters:
valueDeseralizationContext-problemPath-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:IPartTypeGet the base block state that will be rendered for this part. An appropriateIgnoredBlock.FACINGproperty will be set.- Specified by:
getBlockStatein interfaceIPartType<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Overrides:
getBlockStatein classPartTypeBase<PartTypeConnectorMonoDirectional,PartTypeConnectorMonoDirectional.State> - Parameters:
partContainer- The part entity.side- The position of the part.- Returns:
- The block state to render with.
-