Interface ITerminalStorageTabClient<S extends ITerminalStorageSlot>

All Known Implementing Classes:
TerminalStorageTabIngredientComponentClient, TerminalStorageTabIngredientComponentItemStackCraftingClient

public interface ITerminalStorageTabClient<S extends ITerminalStorageSlot>
A client-side terminal storage tab.
  • Field Details

  • Method Details

    • onSelect

      void onSelect(int channel)
      When this tab is selected by the player.
      Parameters:
      channel - The channel.
    • onDeselect

      void onDeselect(int channel)
      When this tab is deselected by the player.
      Parameters:
      channel - The channel.
    • getName

      net.minecraft.resources.ResourceLocation getName()
      Returns:
      The unique tab name, as inherited from ITerminalStorageTab.getName().
    • getTabSettingsName

      default net.minecraft.resources.ResourceLocation getTabSettingsName()
      Returns:
      The tab name that will be used to store TerminalStorageState settings inside a tab. This can be used to modify in what tab certain settings are stored.
    • getIcon

      net.minecraft.world.item.ItemStack getIcon()
      Returns:
      An icon for the tab.
    • getTooltip

      List<net.minecraft.network.chat.Component> getTooltip()
      Returns:
      A tooltip when hovering over the icon.
    • getInstanceFilter

      String getInstanceFilter(int channel)
      Get the currently active filter.
      Parameters:
      channel - The channel to get the filter for.
      Returns:
      The active filter.
    • setInstanceFilter

      void setInstanceFilter(int channel, String filter)
      Set a filter for instances in slots.
      Parameters:
      filter - A string-based filter, which could be a regex.
      channel - The channel to filter in.
    • getSlots

      List<S> getSlots(int channel, int offset, int limit)
      Get a subset of slots.
      Parameters:
      channel - A channel id.
      offset - A slot offset.
      limit - A slot limit.
      Returns:
      A list of slots, can be empty.
    • getRowColumnProvider

      ITerminalRowColumnProvider getRowColumnProvider()
      Returns:
      The current provider of row and column count.
    • isEnabled

      boolean isEnabled()
      Returns:
      If this tab is enabled.
    • getSlotCount

      int getSlotCount(int channel)
      Get the total number of slots in the given channel
      Parameters:
      channel - A channel id.
      Returns:
      A slot count.
    • getStatus

      String getStatus(int channel)
      Parameters:
      channel - A channel id.
      Returns:
      A status string.
    • getChannels

      int[] getChannels()
      Returns:
      All available channels.
    • resetActiveSlot

      void resetActiveSlot()
      Unselect the active storage slot.
    • handleClick

      boolean handleClick(net.minecraft.world.inventory.AbstractContainerMenu container, int channel, int hoveringStorageSlot, int mouseButton, boolean hasClickedOutside, boolean hasClickedInStorage, int hoveredContainerSlot)
      Called when a mouse click happens in a gui.
      Parameters:
      container - The active container.
      channel - The active channel.
      hoveringStorageSlot - The storage slot id that is being hovered. -1 if none.
      mouseButton - The mouse button.
      hasClickedOutside - If the player has clicked outside the gui.
      hasClickedInStorage - If the player has clicked inside the storage space. This can be true even if the storage slot is -1.
      hoveredContainerSlot - The container slot id that is being hovered. -1 if none.
      Returns:
      If further click processing should stop.
    • handleScroll

      boolean handleScroll(net.minecraft.world.inventory.AbstractContainerMenu container, int channel, int hoveringStorageSlot, double delta, boolean hasClickedOutside, boolean hasClickedInStorage, int hoveredContainerSlot)
      Called when a mouse scroll happens in a gui.
      Parameters:
      container - The active container.
      channel - The active channel.
      hoveringStorageSlot - The storage slot id that is being hovered. -1 if none.
      delta - The scroll delta.
      hasClickedOutside - If the player has clicked outside the gui.
      hasClickedInStorage - If the player has clicked inside the storage space. This can be true even if the storage slot is -1.
      hoveredContainerSlot - The container slot id that is being hovered. -1 if none.
      Returns:
      If further click processing should stop.
    • getActiveSlotId

      int getActiveSlotId()
      Returns:
      The active storage slot id.
    • getActiveSlotQuantity

      int getActiveSlotQuantity()
      Returns:
      The active storage slot quantity.
    • setActiveSlotQuantity

      void setActiveSlotQuantity(int quantity)
      Set the active quantity.
      Parameters:
      quantity - A quantity to set.
    • getButtons

      List<ITerminalButton<?,?,?>> getButtons()
      Returns:
      Buttons that are available for this tab.
    • getSlotOffsetX

      default int getSlotOffsetX()
    • getSlotOffsetY

      default int getSlotOffsetY()
    • getSlotVisibleRows

      default int getSlotVisibleRows()
    • getSlotRowLength

      default int getSlotRowLength()
    • getPlayerInventoryOffsetX

      default int getPlayerInventoryOffsetX()
    • getPlayerInventoryOffsetY

      default int getPlayerInventoryOffsetY()
    • getBackgroundTexture

      @Nullable default net.minecraft.resources.ResourceLocation getBackgroundTexture()
      Returns:
      An optional alternative background texture that should be used when rendering the gui of the tab.
    • onTabBackgroundRender

      default void onTabBackgroundRender(ContainerScreenTerminalStorage<?,?> screen, com.mojang.blaze3d.vertex.PoseStack matrixStack, float f, int mouseX, int mouseY)
    • onCommonSlotRender

      default void onCommonSlotRender(net.minecraft.client.gui.screens.inventory.AbstractContainerScreen gui, com.mojang.blaze3d.vertex.PoseStack matrixStack, ContainerScreenTerminalStorage.DrawLayer layer, float partialTick, int x, int y, int mouseX, int mouseY, int slot, ITerminalStorageTabCommon tabCommon)
    • isSlotValidForDraggingInto

      boolean isSlotValidForDraggingInto(int channel, net.minecraft.world.inventory.Slot slot)
      Check if we can drag over the current slot with an active instance.
      Parameters:
      channel - The active channel.
      slot - The slot to drag over.
      Returns:
      If we can drag over the slot.
    • computeDraggingQuantity

      int computeDraggingQuantity(Set<net.minecraft.world.inventory.Slot> dragSlots, int dragMode, net.minecraft.world.item.ItemStack stack, int quantity)
      Calculate the quantity that will be added to the given stack based on the drag mode and the given list of slots.
      Parameters:
      dragSlots - The list of slots to drag over.
      dragMode - The drag mode.
      stack - The stack to calculate the quantity for.
      quantity - The available quantity to drag.
      Returns:
      The quantity that will be added.
    • dragIntoSlot

      int dragIntoSlot(net.minecraft.world.inventory.AbstractContainerMenu container, int channel, net.minecraft.world.inventory.Slot slot, int quantity, boolean simulate)
      Drag the given quantity into the given slot with the currently active instance.
      Parameters:
      container - The active container.
      channel - The active channel.
      slot - The slot to drag into.
      quantity - The quantity to insert.
      simulate - If insertion should only be simulated.
      Returns:
      The quantity that was inserted.