Class PartTypeTerminal<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
java.lang.Object
org.cyclops.integrateddynamics.api.part.PartTypeAdapter<P,S>
org.cyclops.integrateddynamics.core.part.PartTypeBase<P,S>
org.cyclops.integrateddynamics.core.part.panel.PartTypePanel<P,S>
org.cyclops.integratedterminals.core.part.PartTypeTerminal<P,S>
- All Implemented Interfaces:
org.cyclops.integrateddynamics.api.network.INetworkEventListener<org.cyclops.integrateddynamics.api.network.IPartNetworkElement<P,,S>> org.cyclops.integrateddynamics.api.part.IPartType<P,S>
- Direct Known Subclasses:
PartTypeTerminalCraftingJob,PartTypeTerminalStorage
public abstract class PartTypeTerminal<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
extends org.cyclops.integrateddynamics.core.part.panel.PartTypePanel<P,S>
Base part for a terminal.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cyclops.integrateddynamics.core.part.PartTypeBase
org.cyclops.integrateddynamics.core.part.PartTypeBase.IEventAction<P extends org.cyclops.integrateddynamics.api.part.IPartType<P,S>, S extends org.cyclops.integrateddynamics.api.part.IPartState<P>, E extends org.cyclops.integrateddynamics.api.network.event.INetworkEvent> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleThe maximum squared distance from which players can interact with terminal parts, as for vanilla containers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanInteractWith(net.minecraft.world.entity.player.Player player, org.cyclops.integrateddynamics.api.part.PartPos partPos, org.cyclops.integrateddynamics.api.part.IPartType<?, ?> partType) Check if a player can interact with a part at a position that was sent by the client.protected net.minecraft.world.level.block.BlockcreateBlock(org.cyclops.cyclopscore.config.extendedconfig.BlockConfig blockConfig) org.cyclops.cyclopscore.init.ModBasegetMod()booleanstatic booleanisWithinInteractionDistance(net.minecraft.world.entity.player.Player player, org.cyclops.integrateddynamics.api.part.PartPos partPos) Check if a player is close enough to a part position to interact with it.net.minecraft.world.InteractionResultonPartActivated(S partState, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.phys.BlockHitResult hit) Methods inherited from class org.cyclops.integrateddynamics.core.part.PartTypeBase
addDrops, constructNetworkEventActions, createItem, createNetworkElement, createTranslationKey, forceLightTransparency, getBaseBlockState, getBlock, getBlockModelPath, getBlockState, getItem, getModId, getPartRenderPosition, getSubscribedEvents, getUniqueName, hasEventSubscriptions, loadTooltip, loadTooltip, onEvent, registerBlock, writeExtraGuiDataMethods inherited from class org.cyclops.integrateddynamics.api.part.PartTypeAdapter
afterNetworkAlive, afterNetworkReAlive, beforeNetworkKill, constructDefaultState, defaultBlockState, fromNBT, getChannel, getCloneItemStack, getConsumptionRate, getItemStack, getMinimumUpdateInterval, getPriority, getState, getTarget, getTargetOffset, getTargetSideOverride, getTranslationKey, getUpdateInterval, hasOffsetVariables, isEnabled, isSolid, onBlockNeighborChange, onNetworkAddition, onNetworkRemoval, onOffsetVariablesChanged, onPostRemoved, onPreRemoved, postUpdate, setEnabled, setPriorityAndChannel, setTargetOffset, setTargetSideOverride, setUpdateInterval, shouldTriggerBlockRenderUpdate, toNBT, 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, supportsOffsets, writeExtraGuiDataOffsets, writeExtraGuiDataSettings
-
Field Details
-
MAX_INTERACTION_DISTANCE_SQ
public static final double MAX_INTERACTION_DISTANCE_SQThe maximum squared distance from which players can interact with terminal parts, as for vanilla containers.- See Also:
-
-
Constructor Details
-
PartTypeTerminal
-
-
Method Details
-
isWithinInteractionDistance
public static boolean isWithinInteractionDistance(net.minecraft.world.entity.player.Player player, org.cyclops.integrateddynamics.api.part.PartPos partPos) Check if a player is close enough to a part position to interact with it.- Parameters:
player- A player.partPos- A part position.- Returns:
- If the position is in the player's level, loaded, and within interaction distance.
-
canInteractWith
public static boolean canInteractWith(net.minecraft.world.entity.player.Player player, org.cyclops.integrateddynamics.api.part.PartPos partPos, org.cyclops.integrateddynamics.api.part.IPartType<?, ?> partType) Check if a player can interact with a part at a position that was sent by the client.- Parameters:
player- A player.partPos- A part position.partType- The expected part type.- Returns:
- If the part is within interaction distance and has the expected type.
-
onPartActivated
public net.minecraft.world.InteractionResult onPartActivated(S partState, net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level world, net.minecraft.world.entity.player.Player player, net.minecraft.world.InteractionHand hand, net.minecraft.world.item.ItemStack heldItem, net.minecraft.world.phys.BlockHitResult hit) - Specified by:
onPartActivatedin interfaceorg.cyclops.integrateddynamics.api.part.IPartType<P extends PartTypeTerminal<P,S>, S extends org.cyclops.integrateddynamics.api.part.IPartState<P>> - Overrides:
onPartActivatedin classorg.cyclops.integrateddynamics.core.part.PartTypeBase<P extends PartTypeTerminal<P,S>, S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
-
createBlock
protected net.minecraft.world.level.block.Block createBlock(org.cyclops.cyclopscore.config.extendedconfig.BlockConfig blockConfig) -
getMod
public org.cyclops.cyclopscore.init.ModBase getMod() -
isUpdate
- Specified by:
isUpdatein interfaceorg.cyclops.integrateddynamics.api.part.IPartType<P extends PartTypeTerminal<P,S>, S extends org.cyclops.integrateddynamics.api.part.IPartState<P>> - Overrides:
isUpdatein classorg.cyclops.integrateddynamics.api.part.PartTypeAdapter<P extends PartTypeTerminal<P,S>, S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
-