Class CottonInventoryScreen<T extends SyncedGuiDescription>

java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
net.minecraft.client.gui.screen.ingame.HandledScreen<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.Drawable, net.minecraft.client.gui.Element, net.minecraft.client.gui.ParentElement, net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider<T>

public class CottonInventoryScreen<T extends SyncedGuiDescription> extends net.minecraft.client.gui.screen.ingame.HandledScreen<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.screen.Screen

    net.minecraft.client.gui.screen.Screen.SelectedElementNarrationData
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected @Nullable WWidget
     

    Fields inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen

    BACKGROUND_TEXTURE, backgroundHeight, backgroundWidth, cursorDragging, cursorDragSlots, field_32322, focusedSlot, handler, playerInventoryTitle, playerInventoryTitleX, playerInventoryTitleY, titleX, titleY, x, y

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

    client, height, itemRenderer, passEvents, textRenderer, title, width

    Fields inherited from class net.minecraft.client.gui.DrawableHelper

    GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE

    Fields inherited from interface net.minecraft.client.gui.Element

    MAX_DOUBLE_CLICK_INTERVAL
  • Constructor Summary

    Constructors
    Constructor
    Description
    CottonInventoryScreen(T description, net.minecraft.entity.player.PlayerEntity player)
    Constructs a new screen without a title.
    CottonInventoryScreen(T description, net.minecraft.entity.player.PlayerEntity player, net.minecraft.text.Text title)
    Constructs a new screen.
    CottonInventoryScreen(T description, net.minecraft.entity.player.PlayerInventory inventory)
    Constructs a new screen without a title.
    CottonInventoryScreen(T description, net.minecraft.entity.player.PlayerInventory inventory, net.minecraft.text.Text title)
    Constructs a new screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    addElementNarrations(net.minecraft.client.gui.screen.narration.NarrationMessageBuilder builder)
     
    boolean
    changeFocus(boolean lookForwards)
     
    boolean
    charTyped(char ch, int keyCode)
     
    protected void
    drawBackground(net.minecraft.client.util.math.MatrixStack matrices, float partialTicks, int mouseX, int mouseY)
     
    protected void
    drawForeground(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY)
     
     
     
    protected void
     
    void
     
    boolean
    keyPressed(int ch, int keyCode, int modifiers)
     
    boolean
    keyReleased(int ch, int keyCode, int modifiers)
     
    boolean
    mouseClicked(double mouseX, double mouseY, int mouseButton)
     
    boolean
    mouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY)
     
    void
    mouseMoved(double mouseX, double mouseY)
     
    boolean
    mouseReleased(double mouseX, double mouseY, int mouseButton)
     
    boolean
    mouseScrolled(double mouseX, double mouseY, double amount)
     
    void
     
    void
    render(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY, float partialTicks)
     
    void
    renderTextHover(net.minecraft.client.util.math.MatrixStack matrices, @Nullable net.minecraft.text.Style textStyle, int x, int y)
     
    protected void
    reposition(int screenWidth, int screenHeight)
    Repositions the root panel.
    void
     
    boolean
     

    Methods inherited from class net.minecraft.client.gui.screen.ingame.HandledScreen

    close, drawMouseoverTooltip, drawSlotHighlight, getScreenHandler, handleHotbarKeyPressed, isClickOutsideBounds, isPointWithinBounds, onMouseClick, tick

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

    addDrawable, addDrawableChild, addScreenNarrations, addSelectableChild, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, applyNarratorModeChangeDelay, children, clearChildren, filesDragged, findSelectedElementData, getNarratedTitle, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, hide, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrateScreenIfNarrationEnabled, remove, renderBackground, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, shouldCloseOnEsc, updateNarrator, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.AbstractParentElement

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class net.minecraft.client.gui.DrawableHelper

    drawCenteredText, drawCenteredText, drawCenteredTextWithShadow, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, drawWithOutline, drawWithShadow, fill, fillGradient, fillGradient, fillGradient, getZOffset, setZOffset

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface net.minecraft.client.gui.ParentElement

    focusOn, hoveredElement, setInitialFocus
  • Field Details

  • Constructor Details

    • CottonInventoryScreen

      public CottonInventoryScreen(T description, net.minecraft.entity.player.PlayerInventory 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.entity.player.PlayerInventory inventory, net.minecraft.text.Text 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.entity.player.PlayerEntity player)
      Constructs a new screen without a title.
      Parameters:
      description - the GUI description
      player - the player
    • CottonInventoryScreen

      public CottonInventoryScreen(T description, net.minecraft.entity.player.PlayerEntity player, net.minecraft.text.Text 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.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • removed

      public void removed()
      Overrides:
      removed in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • getDescription

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

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

      public void setLastResponder(@Nullable @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
    • shouldPause

      public boolean shouldPause()
      Overrides:
      shouldPause in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • charTyped

      public boolean charTyped(char ch, int keyCode)
      Specified by:
      charTyped in interface net.minecraft.client.gui.Element
      Specified by:
      charTyped in interface net.minecraft.client.gui.ParentElement
    • keyPressed

      public boolean keyPressed(int ch, int keyCode, int modifiers)
      Specified by:
      keyPressed in interface net.minecraft.client.gui.Element
      Specified by:
      keyPressed in interface net.minecraft.client.gui.ParentElement
      Overrides:
      keyPressed in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • keyReleased

      public boolean keyReleased(int ch, int keyCode, int modifiers)
      Specified by:
      keyReleased in interface net.minecraft.client.gui.Element
      Specified by:
      keyReleased in interface net.minecraft.client.gui.ParentElement
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int mouseButton)
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.Element
      Specified by:
      mouseClicked in interface net.minecraft.client.gui.ParentElement
      Overrides:
      mouseClicked in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • mouseReleased

      public boolean mouseReleased(double mouseX, double mouseY, int mouseButton)
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.Element
      Specified by:
      mouseReleased in interface net.minecraft.client.gui.ParentElement
      Overrides:
      mouseReleased in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • mouseDragged

      public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY)
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.Element
      Specified by:
      mouseDragged in interface net.minecraft.client.gui.ParentElement
      Overrides:
      mouseDragged in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double amount)
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.Element
      Specified by:
      mouseScrolled in interface net.minecraft.client.gui.ParentElement
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
      Specified by:
      mouseMoved in interface net.minecraft.client.gui.Element
    • drawBackground

      protected void drawBackground(net.minecraft.client.util.math.MatrixStack matrices, float partialTicks, int mouseX, int mouseY)
      Specified by:
      drawBackground in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • render

      public void render(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY, float partialTicks)
      Specified by:
      render in interface net.minecraft.client.gui.Drawable
      Overrides:
      render in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • drawForeground

      protected void drawForeground(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY)
      Overrides:
      drawForeground in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • handledScreenTick

      protected void handledScreenTick()
      Overrides:
      handledScreenTick in class net.minecraft.client.gui.screen.ingame.HandledScreen<T extends SyncedGuiDescription>
    • renderTextHover

      public void renderTextHover(net.minecraft.client.util.math.MatrixStack matrices, @Nullable @Nullable net.minecraft.text.Style textStyle, int x, int y)
      Specified by:
      renderTextHover in interface io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
    • changeFocus

      public boolean changeFocus(boolean lookForwards)
      Specified by:
      changeFocus in interface net.minecraft.client.gui.Element
      Specified by:
      changeFocus in interface net.minecraft.client.gui.ParentElement
    • addElementNarrations

      protected void addElementNarrations(net.minecraft.client.gui.screen.narration.NarrationMessageBuilder builder)
      Overrides:
      addElementNarrations in class net.minecraft.client.gui.screen.Screen