Class ContainerScreenLogicProgrammerBase<C extends ContainerLogicProgrammerBase>

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C>
org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended<C>
org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C>
org.cyclops.integrateddynamics.client.gui.container.ContainerScreenLogicProgrammerBase<C>
All Implemented Interfaces:
net.minecraft.client.gui.components.events.ContainerEventHandler, net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.screens.inventory.MenuAccess<C>, org.cyclops.cyclopscore.inventory.IValueNotifiable, ContainerLogicProgrammerBase.ScreenCallbackHandler
Direct Known Subclasses:
ContainerScreenLogicProgrammer, ContainerScreenLogicProgrammerPortable

public class ContainerScreenLogicProgrammerBase<C extends ContainerLogicProgrammerBase> extends org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C> implements ContainerLogicProgrammerBase.ScreenCallbackHandler
Base gui for the logic programmer.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screens.Screen

    net.minecraft.client.gui.screens.Screen.NarratableSearchResult
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    protected final ExpressionStartPanel
     
    protected boolean
     
    protected RenderPattern
     
     
    protected int
     
    protected final SubGuiHolder
     
    protected boolean
     

    Fields inherited from class org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended

    container, offsetX, offsetY, texture

    Fields inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen

    BACKGROUND_TEXTURE_HEIGHT, BACKGROUND_TEXTURE_WIDTH, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, hoveredSlot, imageHeight, imageWidth, INVENTORY_LOCATION, inventoryLabelX, inventoryLabelY, isQuickCrafting, leftPos, menu, playerInventoryTitle, quickCraftSlots, titleLabelX, titleLabelY, topPos

    Fields inherited from class net.minecraft.client.gui.screens.Screen

    FADE_IN_TIME, font, FOOTER_SEPARATOR, HEADER_SEPARATOR, height, INWORLD_FOOTER_SEPARATOR, INWORLD_HEADER_SEPARATOR, MENU_BACKGROUND, minecraft, narratorButton, renderables, screenExecutor, title, width
  • Constructor Summary

    Constructors
    Constructor
    Description
    ContainerScreenLogicProgrammerBase(C container, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    boolean
    charTyped(net.minecraft.client.input.CharacterEvent evt)
     
    protected float
    colorSmoothener(float color, boolean hover)
     
    protected net.minecraft.resources.Identifier
     
    void
     
    protected void
    drawBackgroundTexture(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks)
    Draw the background texture, and the expression side panel to the right of it, which the texture partly covers.
    protected void
    drawCurrentScreen(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks)
     
    static void
    drawPanel(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int width, int height)
    Draw a panel in the vanilla style.
    void
    extractBackground(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks)
     
    protected void
    extractLabels(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY)
     
    protected void
    extractTooltip(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY)
     
    protected int
     
    protected int
     
    protected static net.minecraft.network.chat.MutableComponent
     
    protected Rectangle
    getElementPosition(ContainerLogicProgrammerBase container, int i, boolean absolute)
     
     
     
     
    protected int
     
    protected Rectangle
     
    protected int
     
    protected int
     
    protected int
     
    protected int
     
    protected List<net.minecraft.network.chat.Component>
    getTooltipFromContainerItem(net.minecraft.world.item.ItemStack itemStack)
     
    boolean
    handleElementActivation(ILogicProgrammerElement element, boolean sendToServer)
     
    protected boolean
    handleKeyCode(net.minecraft.client.input.KeyEvent evt)
     
    protected boolean
     
    void
     
    protected boolean
     
    static boolean
     
    protected boolean
     
    boolean
    keyPressed(net.minecraft.client.input.KeyEvent evt)
     
    protected void
    label(String label)
     
    boolean
    mouseClicked(net.minecraft.client.input.MouseButtonEvent evt, boolean isDoubleClick)
     
    boolean
    mouseDragged(net.minecraft.client.input.MouseButtonEvent evt, double dragX, double dragY)
     
    boolean
    mouseReleased(net.minecraft.client.input.MouseButtonEvent evt)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
     
    protected void
     
    void
     
    protected void
     
    void
    Called when the expression node being edited in the active operator element has changed.
    void
    Called when another expression is edited, so typed text is thrown away.
    protected boolean
    selectPageElement(int elementId)
     
    protected void
    setSearchFieldFocussed(boolean focused)
     
    protected void
    slotClicked(net.minecraft.world.inventory.Slot slot, int slotId, int mouseButton, net.minecraft.world.inventory.ContainerInput clickType)
     

    Methods inherited from class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling

    getScrollbar, getSearchField, getSearchY, getTotalRows, isSearchEnabled, isSubsetRenderSlots, updateSearch

    Methods inherited from class org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended

    createServerPressable, drawTooltip, extractRenderState, getGuiLeftTotal, getGuiTexture, getGuiTopTotal, getValueNotifiableType, isHovering, isHovering, isPointInRegion, onUpdate, refreshValues

    Methods inherited from class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen

    addItemSlotMouseAction, checkHotbarKeyPressed, extractCarriedItem, extractContents, extractSlot, extractSlots, getHoveredSlot, getImageHeight, getImageWidth, getLeftPos, getMenu, getTopPos, handleSlotStateChanged, hasClickedOutside, isInGameUi, isPauseScreen, onMouseClickAction, removed, renderSlotContents, tick

    Methods inherited from class net.minecraft.client.gui.screens.Screen

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBlurredBackground, extractMenuBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, findNarratableWidget, getBackgroundMusic, getFont, getMinecraft, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInputCaptured, isMouseOver, isValidCharacterForName, onFilesDrop, rebuildWidgets, removeWidget, repositionElements, resize, scheduleNarration, setInitialFocus, setInitialFocus, shouldCloseOnEsc, shouldNarrateNavigation, showsActiveEffects, triggerImmediateNarration, updateNarratedWidget, updateNarrationState, updateNarratorStatus

    Methods inherited from class net.minecraft.client.gui.components.events.AbstractContainerEventHandler

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.client.gui.components.events.ContainerEventHandler

    getBorderForArrowNavigation, getChildAt, getCurrentFocusPath, isFocused, keyReleased, nextFocusPath, preeditUpdated, setFocused

    Methods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    capturesInput, mouseMoved, shouldTakeFocusAfterInteraction

    Methods inherited from interface net.minecraft.client.gui.components.TabOrderedElement

    getTabOrderGroup
  • Field Details

  • Constructor Details

    • ContainerScreenLogicProgrammerBase

      public ContainerScreenLogicProgrammerBase(C container, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title)
  • Method Details

    • getScrollRegion

      protected Rectangle getScrollRegion()
      Overrides:
      getScrollRegion in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • init

      public void init()
      Overrides:
      init in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • getExpressionTextField

      public ExpressionTextField getExpressionTextField()
      Returns:
      The typed text of the expression, kept while the panel of the active element is recreated.
    • resetExpressionText

      public void resetExpressionText()
      Description copied from interface: ContainerLogicProgrammerBase.ScreenCallbackHandler
      Called when another expression is edited, so typed text is thrown away.
      Specified by:
      resetExpressionText in interface ContainerLogicProgrammerBase.ScreenCallbackHandler
    • containerTick

      public void containerTick()
      Overrides:
      containerTick in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • onClose

      public void onClose()
      Overrides:
      onClose in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • applyPendingText

      protected void applyPendingText()
    • getExpressionDraftError

      @Nullable public ExpressionParseException getExpressionDraftError()
      Returns:
      Why the typed text of the expression can not be applied, which keeps the card from being written, or null.
    • slotClicked

      protected void slotClicked(@Nullable net.minecraft.world.inventory.Slot slot, int slotId, int mouseButton, net.minecraft.world.inventory.ContainerInput clickType)
      Overrides:
      slotClicked in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • getScrollX

      protected int getScrollX()
      Overrides:
      getScrollX in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • getScrollY

      protected int getScrollY()
      Overrides:
      getScrollY in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • getScrollHeight

      protected int getScrollHeight()
      Overrides:
      getScrollHeight in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • getBaseXSize

      protected int getBaseXSize()
      Overrides:
      getBaseXSize in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended<C extends ContainerLogicProgrammerBase>
    • isExpressionPanelOpen

      public static boolean isExpressionPanelOpen()
      Returns:
      If the expression side panel is shown.
    • getBaseYSize

      protected int getBaseYSize()
      Overrides:
      getBaseYSize in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended<C extends ContainerLogicProgrammerBase>
    • getSearchX

      protected int getSearchX()
      Overrides:
      getSearchX in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • getSearchWidth

      protected int getSearchWidth()
      Overrides:
      getSearchWidth in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • constructGuiTexture

      protected net.minecraft.resources.Identifier constructGuiTexture()
      Specified by:
      constructGuiTexture in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenExtended<C extends ContainerLogicProgrammerBase>
    • colorSmoothener

      protected float colorSmoothener(float color, boolean hover)
    • extractBackground

      public void extractBackground(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      extractBackground in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • drawBackgroundTexture

      protected void drawBackgroundTexture(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks)
      Draw the background texture, and the expression side panel to the right of it, which the texture partly covers.
      Parameters:
      guiGraphics - The gui graphics.
    • drawPanel

      public static void drawPanel(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int x, int y, int width, int height)
      Draw a panel in the vanilla style.
    • onExpressionNavigated

      public void onExpressionNavigated()
      Called when the expression node being edited in the active operator element has changed.
      Specified by:
      onExpressionNavigated in interface ContainerLogicProgrammerBase.ScreenCallbackHandler
    • getElementPosition

      protected Rectangle getElementPosition(ContainerLogicProgrammerBase container, int i, boolean absolute)
    • drawCurrentScreen

      protected void drawCurrentScreen(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      drawCurrentScreen in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • extractTooltip

      protected void extractTooltip(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY)
      Overrides:
      extractTooltip in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • getTooltipFromContainerItem

      protected List<net.minecraft.network.chat.Component> getTooltipFromContainerItem(net.minecraft.world.item.ItemStack itemStack)
      Overrides:
      getTooltipFromContainerItem in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • extractLabels

      protected void extractLabels(net.minecraft.client.gui.GuiGraphicsExtractor guiGraphics, int mouseX, int mouseY)
      Overrides:
      extractLabels in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • onActivateElement

    • isElementShown

      protected boolean isElementShown(ILogicProgrammerElement element)
      Returns:
      If the element is shown as selected: the active element, or the operator that is open in the slots of an expression.
    • onDeactivateElement

      protected void onDeactivateElement(ILogicProgrammerElement element)
    • handleElementActivation

      public boolean handleElementActivation(ILogicProgrammerElement element, boolean sendToServer)
      Specified by:
      handleElementActivation in interface ContainerLogicProgrammerBase.ScreenCallbackHandler
    • getOperatorConfigPattern

      @Nullable public RenderPattern getOperatorConfigPattern()
      Specified by:
      getOperatorConfigPattern in interface ContainerLogicProgrammerBase.ScreenCallbackHandler
    • setSearchFieldFocussed

      protected void setSearchFieldFocussed(boolean focused)
    • isSearchFieldFocussed

      protected boolean isSearchFieldFocussed()
    • selectPageElement

      protected boolean selectPageElement(int elementId)
    • handleKeyCode

      protected boolean handleKeyCode(net.minecraft.client.input.KeyEvent evt)
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharacterEvent evt)
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      charTyped in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyEvent evt)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyPressed in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      keyPressed in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseScrolled in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • mouseDragged

      public boolean mouseDragged(net.minecraft.client.input.MouseButtonEvent evt, double dragX, double dragY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseDragged in class org.cyclops.cyclopscore.client.gui.container.ContainerScreenScrolling<C extends ContainerLogicProgrammerBase>
    • mouseReleased

      public boolean mouseReleased(net.minecraft.client.input.MouseButtonEvent evt)
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseReleased in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent evt, boolean isDoubleClick)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.components.events.GuiEventListener
      Overrides:
      mouseClicked in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<C extends ContainerLogicProgrammerBase>
    • getDraftErrorMessage

      protected static net.minecraft.network.chat.MutableComponent getDraftErrorMessage(ExpressionParseException error)
    • label

      protected void label(String label)
    • hasLabeller

      protected boolean hasLabeller()