All Known Implementing Classes:
AbstractSliderOptions, AirConditionerOptions, BlockTrackOptions, ChestplateLauncherOptions, CoordinateTrackerOptions, CoreComponentsOptions, DroneDebuggerOptions, EntityTrackOptions, HackOptions, IOptionPage.SimpleOptionPage, JetBootsOptions, JumpBoostOptions, KickOptions, NullOptions, SearchOptions, SpeedBoostOptions

public interface IOptionPage
An Option Page is the GUI object which holds the control widgets for a particular Pneumatic Armor upgrade. Create and return an instance of this class in IArmorUpgradeClientHandler.getGuiOptionsPage(IGuiScreen).

It is strongly recommended to extend the IOptionPage.SimpleOptionPage class rather than implement this interface directly.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Convenience class for simple armor features with no additional settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Should the "Settings" header be displayed?
    Get a reference to the IGuiScreen object.
    Get the keybinding button for this page, if any.
    net.minecraft.network.chat.MutableComponent
    This text is used in the GUI button for this page.
    boolean
    Can this upgrade be toggled on & off? If true, a checkbox (with the ability to bind a key) will be automatically displayed in this upgrade's GUI.
    boolean
    keyPressed(int keyCode, int scanCode, int modifiers)
    Called by Screen.keyPressed(int, int, int) when a key is pressed.
    boolean
    keyReleased(int keyCode, int scanCode, int modifiers)
    Called by ContainerEventHandler.keyReleased(int, int, int) when a key is released.
    boolean
    mouseClicked(double x, double y, int button)
    Called when mouse is clicked via ContainerEventHandler.mouseClicked(double, double, int)
    boolean
    mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
    Called when the mouse is dragged across the GUI
    boolean
    mouseScrolled(double x, double y, double dir)
    Called when the mouse wheel is rolled.
    void
    Here you can initialize your buttons and stuff like with a Screen.
    void
    renderPost(com.mojang.blaze3d.vertex.PoseStack matrixStack, int x, int y, float partialTicks)
    Called immediately after Screen.render(PoseStack, int, int, float) Here you can render additional things like text.
    void
    renderPre(com.mojang.blaze3d.vertex.PoseStack matrixStack, int x, int y, float partialTicks)
    Called immediately before Screen.render(PoseStack, int, int, float)
    default int
    Y position from the "Setting" header.
    default void
    Called immediately after Screen.tick()
  • Method Details

    • getGuiScreen

      IGuiScreen getGuiScreen()
      Get a reference to the IGuiScreen object. You can use this to get the font renderer, for example.
      Returns:
      the screen
    • getPageName

      net.minecraft.network.chat.MutableComponent getPageName()
      This text is used in the GUI button for this page.
      Returns:
      the page name
    • populateGui

      void populateGui(IGuiScreen gui)
      Here you can initialize your buttons and stuff like with a Screen.
      Parameters:
      gui - the holding GUI
    • renderPre

      void renderPre(com.mojang.blaze3d.vertex.PoseStack matrixStack, int x, int y, float partialTicks)
      Called immediately before Screen.render(PoseStack, int, int, float)
      Parameters:
      matrixStack - the matrix stack
      x - mouse X
      y - mouse Y
      partialTicks - partial ticks since last world ticks
    • renderPost

      void renderPost(com.mojang.blaze3d.vertex.PoseStack matrixStack, int x, int y, float partialTicks)
      Called immediately after Screen.render(PoseStack, int, int, float) Here you can render additional things like text.
      Parameters:
      matrixStack - the matrix stack
      x - mouse X
      y - mouse Y
      partialTicks - partial ticks since last world ticks
    • keyPressed

      boolean keyPressed(int keyCode, int scanCode, int modifiers)
      Called by Screen.keyPressed(int, int, int) when a key is pressed.
      Parameters:
      keyCode - typed keycode
      scanCode - the scan code (rarely useful)
      modifiers - key modifiers
      Returns:
      true if the event has been handled, false otherwise
    • keyReleased

      boolean keyReleased(int keyCode, int scanCode, int modifiers)
      Called by ContainerEventHandler.keyReleased(int, int, int) when a key is released.
      Parameters:
      keyCode - typed keycode
      scanCode - the scan code (rarely useful)
      modifiers - key modifiers
      Returns:
      true if the event has been handled, false otherwise
    • mouseClicked

      boolean mouseClicked(double x, double y, int button)
      Called when mouse is clicked via ContainerEventHandler.mouseClicked(double, double, int)
      Parameters:
      x - mouse X
      y - mouse Y
      button - mouse button
      Returns:
      true if the event has been handled, false otherwise
    • mouseScrolled

      boolean mouseScrolled(double x, double y, double dir)
      Called when the mouse wheel is rolled.
      Parameters:
      x - mouse X
      y - mouse Y
      dir - scroll direction
      Returns:
      true if the event has been handled, false otherwise
    • mouseDragged

      boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY)
      Called when the mouse is dragged across the GUI
      Parameters:
      mouseX - mouse X
      mouseY - mouse Y
      button - mouse button
      dragX - drag X
      dragY - drag Y
      Returns:
      true if the event has been handled, false otherwise
    • isToggleable

      boolean isToggleable()
      Can this upgrade be toggled on & off? If true, a checkbox (with the ability to bind a key) will be automatically displayed in this upgrade's GUI.
      Returns:
      true if the upgrade is toggleable, false otherwise
    • displaySettingsHeader

      boolean displaySettingsHeader()
      Should the "Settings" header be displayed?
      Returns:
      true if the header should be displayed, false otherwise
    • settingsYposition

      default int settingsYposition()
      Y position from the "Setting" header. The default is fine in most cases, but if your options page has many buttons (e.g. like the Block Tracker), you may wish to adjust this.
      Returns:
      Y position, default 115
    • tick

      default void tick()
      Called immediately after Screen.tick()
    • getKeybindingButton

      default Optional<IKeybindingButton> getKeybindingButton()
      Get the keybinding button for this page, if any. You can create a keybinding button with IPneumaticHelmetRegistry.makeKeybindingButton(int, KeyMapping).
      Returns:
      the keybinding button, or Optional.empty() if there isn't one