Class GuiEventProvider

All Implemented Interfaces:
ElementEvents, GuiParent<GuiEventProvider>, TooltipHandler<GuiEventProvider>

public class GuiEventProvider extends GuiElement<GuiEventProvider>
Created by brandon3055 on 15/11/2023
  • Constructor Details

    • GuiEventProvider

      public GuiEventProvider(GuiParent<?> parent)
  • Method Details

    • setIgnoreConsumed

      public GuiEventProvider setIgnoreConsumed(boolean ignoreConsumed)
    • onMouseClick

      public GuiEventProvider onMouseClick(Consumer<net.minecraft.client.input.MouseButtonEvent> listener)
    • onMouseRelease

      public GuiEventProvider onMouseRelease(Consumer<net.minecraft.client.input.MouseButtonEvent> listener)
    • onMouseMove

    • onScroll

    • onKeyPress

      public GuiEventProvider onKeyPress(Consumer<net.minecraft.client.input.KeyEvent> listener)
    • onKeyRelease

      public GuiEventProvider onKeyRelease(Consumer<net.minecraft.client.input.KeyEvent> listener)
    • onCharTyped

      public GuiEventProvider onCharTyped(Consumer<net.minecraft.client.input.CharacterEvent> listener)
    • mouseClicked

      public boolean mouseClicked(net.minecraft.client.input.MouseButtonEvent event, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for mouseClick event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of mouseClick handling should be implemented via ElementEvents.mouseClicked(MouseButtonEvent)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      event - The mouse button event. Position, Key, and modifiers.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • mouseReleased

      public boolean mouseReleased(net.minecraft.client.input.MouseButtonEvent event, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for mouseReleased event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of mouseReleased handling should be implemented via ElementEvents.mouseReleased(MouseButtonEvent)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      event - The mouse button event. Position, Key, and modifiers.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • mouseMoved

      public void mouseMoved(double mouseX, double mouseY)
      Description copied from interface: ElementEvents
      Called whenever the cursor position changes. Vanillas mouseDragged is not passed through because it is redundant. All mouse drag functionality can be archived using available events.
      Parameters:
      mouseX - new mouse X position
      mouseY - new mouse Y position
    • mouseScrolled

      public boolean mouseScrolled(double mouseX, double mouseY, double scrollX, double scrollY, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for mouseScrolled event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of mouseScrolled handling should be implemented via ElementEvents.mouseScrolled(double, double, double, double)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      mouseX - Mouse X position
      mouseY - Mouse Y position
      scrollX - Scroll direction and amount
      scrollY - Scroll direction and amount
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • keyPressed

      public boolean keyPressed(net.minecraft.client.input.KeyEvent event, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for keyPressed event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of keyPressed handling should be implemented via ElementEvents.keyPressed(KeyEvent)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      event - The key event. Key, scancode, and modifiers.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • keyReleased

      public boolean keyReleased(net.minecraft.client.input.KeyEvent event, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for keyReleased event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of keyReleased handling should be implemented via ElementEvents.keyReleased(KeyEvent)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      event - The key event. Key, scancode, and modifiers.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.
    • charTyped

      public boolean charTyped(net.minecraft.client.input.CharacterEvent event, boolean consumed)
      Description copied from interface: ElementEvents
      Root handler for charTyped event. This method will always be called for all elements even if the event has already been consumed. There are a few uses for this method, but the fast majority of charTyped handling should be implemented via ElementEvents.charTyped(CharacterEvent)

      Note: If overriding this method, do so with caution, You must either return true (if you wish to consume the event) or you must return the result of the super call.

      Parameters:
      event - The character event, codepoint and modifiers.
      consumed - Will be true if this action has already been consumed.
      Returns:
      true if this event has been consumed.