Class CottonInventoryScreen<T extends SyncedGuiDescription>

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T>
io.github.cottonmc.cotton.gui.client.CottonInventoryScreen<T>
Type Parameters:
T - the description type
All Implemented Interfaces:
io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl, 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>

public class CottonInventoryScreen<T extends SyncedGuiDescription> extends net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T> implements io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
A screen for a SyncedGuiDescription.
  • 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 SyncedGuiDescription
     
    protected @Nullable WWidget
     

    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
    Constructor
    Description
    CottonInventoryScreen(T description, net.minecraft.world.entity.player.Inventory inventory)
    Constructs a new screen without a title.
    CottonInventoryScreen(T description, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.network.chat.Component title)
    Constructs a new screen.
    CottonInventoryScreen(T description, net.minecraft.world.entity.player.Player player)
    Constructs a new screen without a title.
    CottonInventoryScreen(T description, net.minecraft.world.entity.player.Player player, net.minecraft.network.chat.Component title)
    Constructs a new screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    boolean
    charTyped(net.minecraft.client.input.CharacterEvent input)
     
    protected void
     
    protected void
    extractLabels(net.minecraft.client.gui.GuiGraphicsExtractor context, int mouseX, int mouseY)
     
    void
    extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a)
     
    protected void
    extractTooltip(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY)
     
     
     
    void
     
    boolean
     
    boolean
    keyPressed(net.minecraft.client.input.KeyEvent input)
     
    boolean
    keyReleased(net.minecraft.client.input.KeyEvent input)
     
    boolean
    mouseClicked(net.minecraft.client.input.MouseButtonEvent click, boolean doubled)
     
    boolean
    mouseDragged(net.minecraft.client.input.MouseButtonEvent click, double offsetX, double offsetY)
     
    void
    mouseMoved(double mouseX, double mouseY)
     
    boolean
    mouseReleased(net.minecraft.client.input.MouseButtonEvent click)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount)
     
    void
    paintDescription(net.minecraft.client.gui.GuiGraphicsExtractor context, int mouseX, int mouseY, float delta)
    Paints the GUI description of this screen.
    boolean
    preeditUpdated(@Nullable net.minecraft.client.input.PreeditEvent event)
     
    void
     
    protected void
    reposition(int screenWidth, int screenHeight)
    Repositions the root panel.
    void
     
    protected void
    updateNarratedWidget(net.minecraft.client.gui.narration.NarrationElementOutput builder)
     

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

    addItemSlotMouseAction, checkHotbarKeyPressed, clearDraggingState, extractCarriedItem, extractContents, extractSlot, extractSlots, extractSnapbackItem, getMenu, getTooltipFromContainerItem, handleSlotStateChanged, hasClickedOutside, isHovering, isInGameUi, onClose, slotClicked, tick

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

    addRenderableOnly, addRenderableWidget, addWidget, afterKeyboardAction, afterMouseAction, afterMouseMove, canInterruptWithAnotherScreen, changeFocus, children, clearFocus, clearWidgets, clickCommandAction, clickUrlAction, defaultHandleClickEvent, defaultHandleGameClickEvent, extractBackground, 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, 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, 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

  • Constructor Details

    • CottonInventoryScreen

      public CottonInventoryScreen(T description, net.minecraft.world.entity.player.Inventory inventory)
      Constructs a new screen without a title.
      Parameters:
      description - the GUI description
      inventory - the player inventory
      Since:
      5.2.0
    • CottonInventoryScreen

      public CottonInventoryScreen(T description, net.minecraft.world.entity.player.Inventory inventory, net.minecraft.network.chat.Component title)
      Constructs a new screen.
      Parameters:
      description - the GUI description
      inventory - the player inventory
      title - the screen title
      Since:
      5.2.0
    • CottonInventoryScreen

      public CottonInventoryScreen(T description, net.minecraft.world.entity.player.Player player)
      Constructs a new screen without a title.
      Parameters:
      description - the GUI description
      player - the player
    • CottonInventoryScreen

      public CottonInventoryScreen(T description, net.minecraft.world.entity.player.Player player, net.minecraft.network.chat.Component title)
      Constructs a new screen.
      Parameters:
      description - the GUI description
      player - the player
      title - the screen title
  • Method Details

    • init

      public void init()
      Overrides:
      init in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • removed

      public void removed()
      Overrides:
      removed in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • getDescription

      @Internal public GuiDescription getDescription()
      Specified by:
      getDescription in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • getLastResponder

      public @Nullable WWidget getLastResponder()
      Specified by:
      getLastResponder in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • setLastResponder

      public void setLastResponder(@Nullable WWidget lastResponder)
      Specified by:
      setLastResponder in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • reposition

      protected void reposition(int screenWidth, int screenHeight)
      Repositions the root panel.
      Parameters:
      screenWidth - the width of the screen
      screenHeight - the height of the screen
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent click, boolean doubled)
      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<T extends SyncedGuiDescription>
    • mouseReleased

      public boolean mouseReleased(net.minecraft.client.input.MouseButtonEvent click)
      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<T extends SyncedGuiDescription>
    • mouseDragged

      public boolean mouseDragged(net.minecraft.client.input.MouseButtonEvent click, double offsetX, double offsetY)
      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 SyncedGuiDescription>
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount)
      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 net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
      Specified by:
      mouseMoved in interface net.minecraft.client.gui.components.events.GuiEventListener
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharacterEvent input)
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      charTyped in interface net.minecraft.client.gui.components.events.GuiEventListener
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyEvent input)
      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 SyncedGuiDescription>
    • keyReleased

      public boolean keyReleased(net.minecraft.client.input.KeyEvent input)
      Specified by:
      keyReleased in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      keyReleased in interface net.minecraft.client.gui.components.events.GuiEventListener
    • preeditUpdated

      public boolean preeditUpdated(@Nullable net.minecraft.client.input.PreeditEvent event)
      Specified by:
      preeditUpdated in interface net.minecraft.client.gui.components.events.ContainerEventHandler
      Specified by:
      preeditUpdated in interface net.minecraft.client.gui.components.events.GuiEventListener
    • paintDescription

      public void paintDescription(net.minecraft.client.gui.GuiGraphicsExtractor context, int mouseX, int mouseY, float delta)
      Paints the GUI description of this screen.
      Parameters:
      context - the draw context
      mouseX - the absolute X coordinate of the mouse cursor
      mouseY - the absolute Y coordinate of the mouse cursor
      delta - the tick delta
      Since:
      9.2.0
    • extractRenderState

      public void extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a)
      Specified by:
      extractRenderState in interface net.minecraft.client.gui.components.Renderable
      Overrides:
      extractRenderState in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • extractTooltip

      protected void extractTooltip(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY)
      Overrides:
      extractTooltip in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • extractLabels

      protected void extractLabels(net.minecraft.client.gui.GuiGraphicsExtractor context, int mouseX, int mouseY)
      Overrides:
      extractLabels in class net.minecraft.client.gui.screens.inventory.AbstractContainerScreen<T extends SyncedGuiDescription>
    • containerTick

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

      protected void updateNarratedWidget(net.minecraft.client.gui.narration.NarrationElementOutput builder)
      Overrides:
      updateNarratedWidget in class net.minecraft.client.gui.screens.Screen
    • added

      public void added()
      Overrides:
      added in class net.minecraft.client.gui.screens.Screen