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

    Fields
    Modifier and Type
    Field
    Description
    static final double
    The maximum squared distance from which players can interact with terminal parts, as for vanilla containers.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    protected net.minecraft.world.level.block.Block
    createBlock(org.cyclops.cyclopscore.config.extendedconfig.BlockConfig blockConfig)
     
    org.cyclops.cyclopscore.init.ModBase
     
    boolean
    isUpdate(S state)
     
    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.
    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)
     

    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, writeExtraGuiData

    Methods 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, 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, supportsOffsets, writeExtraGuiDataOffsets, writeExtraGuiDataSettings
  • Field Details

    • MAX_INTERACTION_DISTANCE_SQ

      public static final double MAX_INTERACTION_DISTANCE_SQ
      The maximum squared distance from which players can interact with terminal parts, as for vanilla containers.
      See Also:
  • Constructor Details

    • PartTypeTerminal

      public PartTypeTerminal(String name)
  • 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:
      onPartActivated in interface org.cyclops.integrateddynamics.api.part.IPartType<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
      Overrides:
      onPartActivated in class org.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)
      Overrides:
      createBlock in class org.cyclops.integrateddynamics.core.part.panel.PartTypePanel<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
    • getMod

      public org.cyclops.cyclopscore.init.ModBase getMod()
      Overrides:
      getMod in class org.cyclops.integrateddynamics.core.part.PartTypeBase<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
    • isUpdate

      public boolean isUpdate(S state)
      Specified by:
      isUpdate in interface org.cyclops.integrateddynamics.api.part.IPartType<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>
      Overrides:
      isUpdate in class org.cyclops.integrateddynamics.api.part.PartTypeAdapter<P extends PartTypeTerminal<P,S>,S extends org.cyclops.integrateddynamics.api.part.IPartState<P>>