Class AbstractCommandBlockEditScreen

All Implemented Interfaces:
ContainerEventHandler, GuiEventListener, Renderable, TabOrderedElement
Direct Known Subclasses:
CommandBlockEditScreen, MinecartCommandBlockEditScreen

public abstract class AbstractCommandBlockEditScreen extends Screen
  • Field Details

    • SET_COMMAND_LABEL

      private static final Component SET_COMMAND_LABEL
    • COMMAND_LABEL

      private static final Component COMMAND_LABEL
    • PREVIOUS_OUTPUT_LABEL

      private static final Component PREVIOUS_OUTPUT_LABEL
    • commandEdit

      protected EditBox commandEdit
    • previousEdit

      protected EditBox previousEdit
    • doneButton

      protected Button doneButton
    • cancelButton

      protected Button cancelButton
    • outputButton

      protected CycleButton<Boolean> outputButton
    • commandSuggestions

      CommandSuggestions commandSuggestions
  • Constructor Details

    • AbstractCommandBlockEditScreen

      public AbstractCommandBlockEditScreen()
  • Method Details

    • tick

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

      abstract BaseCommandBlock getCommandBlock()
    • getPreviousY

      abstract int getPreviousY()
    • init

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

      protected void setInitialFocus()
      Overrides:
      setInitialFocus in class Screen
    • getUsageNarration

      protected Component getUsageNarration()
      Overrides:
      getUsageNarration in class Screen
    • resize

      public void resize(Minecraft minecraft, int width, int height)
      Overrides:
      resize in class Screen
    • updatePreviousOutput

      protected void updatePreviousOutput(boolean trackOutput)
    • onDone

      protected void onDone()
    • populateAndSendPacket

      protected abstract void populateAndSendPacket(BaseCommandBlock commandBlock)
    • onEdited

      private void onEdited(String command)
    • keyPressed

      public boolean keyPressed(int keyCode, int scanCode, int modifiers)
      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:
      keyCode - the key code of the pressed key.
      scanCode - the scan code of the pressed key.
      modifiers - the keyboard modifiers.
      Returns:
      true if the event is consumed, false otherwise.
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY)
    • mouseClicked

      public boolean mouseClicked(double mouseX, double mouseY, int button)
      Called when a mouse button is clicked within the GUI element.

      Parameters:
      mouseX - the X coordinate of the mouse.
      mouseY - the Y coordinate of the mouse.
      button - the button that was clicked.
      Returns:
      true if the event is consumed, false otherwise.
    • render

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

      public void renderBackground(GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTick)
      Overrides:
      renderBackground in class Screen