Class AbstractSignEditScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement
Direct Known Subclasses:
HangingSignEditScreen, SignEditScreen

public abstract class AbstractSignEditScreen extends Screen
  • Field Details

    • sign

      private final SignBlockEntity sign
      Reference to the sign object.
    • text

      private SignText text
    • messages

      private final String[] messages
    • isFrontText

      private final boolean isFrontText
    • woodType

      protected final WoodType woodType
    • frame

      private int frame
      Counts the number of screen updates.
    • line

      private int line
      The index of the line that is being edited.
    • signField

      @Nullable private TextFieldHelper signField
  • Constructor Details

    • AbstractSignEditScreen

      public AbstractSignEditScreen(SignBlockEntity pSign, boolean pIsFrontText, boolean pIsFiltered)
    • AbstractSignEditScreen

      public AbstractSignEditScreen(SignBlockEntity pSign, boolean pIsFrontText, boolean pIsFiltered, Component pTitle)
  • Method Details

    • init

      protected void init()
      Overrides:
      init in class Screen
    • tick

      public void tick()
      Overrides:
      tick in class Screen
    • isValid

      private boolean isValid()
    • keyPressed

      public boolean keyPressed(int pKeyCode, int pScanCode, int pModifiers)
      Called when a keyboard key is pressed within the GUI element.

      Specified by:
      keyPressed in interface ContainerEventHandler
      Specified by:
      keyPressed in interface GuiEventListener
      Overrides:
      keyPressed in class Screen
      Parameters:
      pKeyCode - the key code of the pressed key.
      pScanCode - the scan code of the pressed key.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • charTyped

      public boolean charTyped(char pCodePoint, int pModifiers)
      Called when a character is typed within the GUI element.

      Parameters:
      pCodePoint - the code point of the typed character.
      pModifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • render

      public void render(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Renders the graphical user interface (GUI) element.
      Specified by:
      render in interface Renderable
      Overrides:
      render in class Screen
      Parameters:
      pGuiGraphics - the GuiGraphics object used for rendering.
      pMouseX - the x-coordinate of the mouse cursor.
      pMouseY - the y-coordinate of the mouse cursor.
      pPartialTick - the partial tick time.
    • renderBackground

      public void renderBackground(GuiGraphics pGuiGraphics, int pMouseX, int pMouseY, float pPartialTick)
      Overrides:
      renderBackground in class Screen
    • onClose

      public void onClose()
      Overrides:
      onClose in class Screen
    • removed

      public void removed()
      Overrides:
      removed in class Screen
    • isPauseScreen

      public boolean isPauseScreen()
      Overrides:
      isPauseScreen in class Screen
    • renderSignBackground

      protected abstract void renderSignBackground(GuiGraphics pGuiGraphics, BlockState pState)
    • getSignTextScale

      protected abstract org.joml.Vector3f getSignTextScale()
    • offsetSign

      protected void offsetSign(GuiGraphics pGuiGraphics, BlockState pState)
    • renderSign

      private void renderSign(GuiGraphics pGuiGraphics)
    • renderSignText

      private void renderSignText(GuiGraphics pGuiGraphics)
    • setMessage

      private void setMessage(String p_277913_)
    • onDone

      private void onDone()