Class CottonClientScreen

java.lang.Object
net.minecraft.client.gui.components.events.AbstractContainerEventHandler
net.minecraft.client.gui.screens.Screen
io.github.cottonmc.cotton.gui.client.CottonClientScreen
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

public class CottonClientScreen extends net.minecraft.client.gui.screens.Screen implements io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
  • 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 GuiDescription
     
    protected @Nullable WWidget
     
    protected int
     
    protected int
    The X coordinate of the screen title.
    protected int
    The Y coordinate of the screen title.
    protected int
     

    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
     
    CottonClientScreen(net.minecraft.network.chat.Component title, GuiDescription description)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    charTyped(net.minecraft.client.input.CharacterEvent input)
     
    void
    extractRenderState(net.minecraft.client.gui.GuiGraphicsExtractor graphics, int mouseX, int mouseY, float a)
     
     
     
    void
     
    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)
     
    boolean
    preeditUpdated(@Nullable net.minecraft.client.input.PreeditEvent event)
     
    void
     
    protected void
    reposition(int screenWidth, int screenHeight)
    Repositions the root panel.
    void
     
    void
     
    protected void
    updateNarratedWidget(net.minecraft.client.gui.narration.NarrationElementOutput builder)
     

    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, extractBackground, extractBlurredBackground, extractMenuBackground, extractMenuBackground, extractMenuBackgroundTexture, extractPanorama, extractRenderStateWithTooltipAndSubtitles, extractTransparentBackground, fadeWidgets, fillCrashDetails, findNarratableWidget, getBackgroundMusic, getFont, getNarrationMessage, getRectangle, getTitle, getTooltipFromItem, getUsageNarration, handleDelayedNarration, init, insertText, isAllowedInPortal, isInGameUi, isMouseOver, isPauseScreen, isValidCharacterForName, onClose, 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

    • description

      protected final GuiDescription description
    • left

      protected int left
    • top

      protected int top
    • titleX

      protected int titleX
      The X coordinate of the screen title. This is relative to the root panel's top-left corner.
      Since:
      2.0.0
    • titleY

      protected int titleY
      The Y coordinate of the screen title. This is relative to the root panel's top-left corner.
      Since:
      2.0.0
    • lastResponder

      protected @Nullable WWidget lastResponder
  • Constructor Details

    • CottonClientScreen

      public CottonClientScreen(GuiDescription description)
    • CottonClientScreen

      public CottonClientScreen(net.minecraft.network.chat.Component title, GuiDescription description)
  • Method Details

    • getDescription

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

      public void init()
      Overrides:
      init in class net.minecraft.client.gui.screens.Screen
    • removed

      public void removed()
      Overrides:
      removed in class net.minecraft.client.gui.screens.Screen
    • 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
    • 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.Screen
    • tick

      public void tick()
      Overrides:
      tick in class net.minecraft.client.gui.screens.Screen
    • 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
    • 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
    • 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
    • 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
    • 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.Screen
    • 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
    • updateNarratedWidget

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