Class AbstractGridScreen<T extends AbstractGridContainerMenu>

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
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<T>
Direct Known Subclasses:
CraftingGridScreen, GridScreen, PatternGridScreen, PortableGridScreen

public abstract class AbstractGridScreen<T extends AbstractGridContainerMenu> extends AbstractStretchingScreen<T>
  • Nested Class Summary

    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
    protected final int
     
    protected static final int
     

    Fields inherited from class AbstractStretchingScreen

    ROW_SIZE, TOP_HEIGHT

    Fields inherited from class AbstractBaseScreen

    TITLE_MAX_WIDTH, titleMarquee

    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, screenExecutor, title, width
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractGridScreen(T menu, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title, int bottomHeight, int width, int height)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    charTyped(net.minecraft.client.input.CharacterEvent event)
     
    protected void
     
    void
    extractBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks)
     
    void
    extractContents(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks)
     
    protected void
    extractSlot(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.world.inventory.Slot slot, int mouseX, int mouseY)
     
    protected void
    extractTooltip(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y)
     
    protected int
     
    protected int
     
    @Nullable GridResource
     
    @Nullable Pin
     
    protected List<net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent>
     
    protected int
     
    protected void
    init(int rows)
     
    boolean
    keyPressed(net.minecraft.client.input.KeyEvent event)
     
    boolean
    keyReleased(net.minecraft.client.input.KeyEvent event)
     
    protected int
     
    boolean
    mouseClicked(net.minecraft.client.input.MouseButtonEvent e, boolean doubleClick)
     
    protected void
    mouseClickedInGrid(int clickedButton, GridResource resource)
     
    boolean
    mouseDragged(net.minecraft.client.input.MouseButtonEvent e, double dx, double dy)
     
    boolean
    mouseReleased(net.minecraft.client.input.MouseButtonEvent e)
     
    boolean
    mouseScrolled(double x, double y, double scrollX, double scrollY)
     
    protected void
     
    protected void
    renderRows(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int topHeight, int rows, int mouseX, int mouseY)
     
    static void
    renderSlotBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int slotX, int slotY, boolean large, int color)
     
    protected void
    renderStretchingBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int rows)
     

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

    addItemSlotMouseAction, checkHotbarKeyPressed, clearDraggingState, extractCarriedItem, extractRenderState, extractSnapbackItem, getMenu, getTooltipFromContainerItem, handleSlotStateChanged, hasClickedOutside, isHovering, isInGameUi, isPauseScreen, onClose, removed, slotClicked, tick

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

    added, addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBlurredBackground, extractMenuBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isMouseOver, isValidCharacterForName, onFilesDrop, panoramaShouldSpin, rebuildWidgets, removeWidget, repositionElements, resize, 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, nextFocusPath, preeditUpdated, setFocused

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

    shouldTakeFocusAfterInteraction

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

    getTabOrderGroup
  • Field Details

    • CLEAR_BUTTON_SIZE

      protected static final int CLEAR_BUTTON_SIZE
      See Also:
    • bottomHeight

      protected final int bottomHeight
  • Constructor Details

    • AbstractGridScreen

      protected AbstractGridScreen(T menu, net.minecraft.world.entity.player.Inventory playerInventory, net.minecraft.network.chat.Component title, int bottomHeight, int width, int height)
  • Method Details

    • init

      protected void init(int rows)
      Overrides:
      init in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • containerTick

      protected void containerTick()
      Overrides:
      containerTick in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends AbstractGridContainerMenu>
    • renderStretchingBackground

      protected void renderStretchingBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int rows)
      Specified by:
      renderStretchingBackground in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • getBottomHeight

      protected int getBottomHeight()
      Specified by:
      getBottomHeight in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • getBottomV

      protected int getBottomV()
      Specified by:
      getBottomV in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • getTopOffset

      protected int getTopOffset()
      Overrides:
      getTopOffset in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • modifyVisibleRows

      protected int modifyVisibleRows(int rows)
      Overrides:
      modifyVisibleRows in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • extractBackground

      public void extractBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      extractBackground in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • renderRows

      protected void renderRows(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y, int topHeight, int rows, int mouseX, int mouseY)
      Specified by:
      renderRows in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • getResourceSlotTooltip

      protected List<net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent> getResourceSlotTooltip(ResourceKey resource, ResourceSlot slot)
      Overrides:
      getResourceSlotTooltip in class AbstractBaseScreen<T extends AbstractGridContainerMenu>
    • extractSlot

      protected void extractSlot(net.minecraft.client.gui.GuiGraphicsExtractor graphics, net.minecraft.world.inventory.Slot slot, int mouseX, int mouseY)
      Overrides:
      extractSlot in class AbstractBaseScreen<T extends AbstractGridContainerMenu>
    • renderSlotBackground

      public static void renderSlotBackground(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int slotX, int slotY, boolean large, int color)
    • extractTooltip

      protected void extractTooltip(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int x, int y)
      Overrides:
      extractTooltip in class AbstractBaseScreen<T extends AbstractGridContainerMenu>
    • getCurrentGridResource

      @API(status=INTERNAL) public @Nullable GridResource getCurrentGridResource()
    • getCurrentPinnedResource

      public @Nullable Pin getCurrentPinnedResource()
    • extractContents

      public void extractContents(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float partialTicks)
      Overrides:
      extractContents in class AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • mouseDragged

      public boolean mouseDragged(net.minecraft.client.input.MouseButtonEvent e, double dx, double dy)
      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 net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends AbstractGridContainerMenu>
    • mouseReleased

      public boolean mouseReleased(net.minecraft.client.input.MouseButtonEvent e)
      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 AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • onPinsUpdated

      protected void onPinsUpdated()
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent e, boolean doubleClick)
      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 AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • mouseClickedInGrid

      protected void mouseClickedInGrid(int clickedButton, GridResource resource)
    • mouseScrolled

      public boolean mouseScrolled(double x, double y, 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 AbstractStretchingScreen<T extends AbstractGridContainerMenu>
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharacterEvent event)
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyEvent event)
      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 net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends AbstractGridContainerMenu>
    • keyReleased

      public boolean keyReleased(net.minecraft.client.input.KeyEvent event)