Interface ApiEntrypoint


public interface ApiEntrypoint
The entry point for other mods to interact with the config editor. This interface allows for extending the functionality of the editor screen by listening to events and rendering custom content.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initializes the API entry point.
    default void
    Called when the editor screen is closed.
    default void
    Called when the editor screen is opened.
    default void
    onMouseDown(int x, int y)
    Called when a mouse button is pressed on the screen.
    default void
    Called when the mouse scroll wheel is used.
    default void
    onType(int keyCode, int scanCode, int modifiers)
    Called when a key is typed on the keyboard.
    default void
    renderButton(DrawContext context, int mouseX, int mouseY, float delta)
    Called to render custom buttons or elements on the screen.
  • Method Details

    • init

      void init()
      Initializes the API entry point. This method is called by the config editor mod during its initialization phase. It is the only required method to be implemented.
    • onEditerOpen

      default void onEditerOpen(EditorScreen editor)
      Called when the editor screen is opened.
      Parameters:
      editor - The instance of the EditorScreen.
    • onEditerClose

      default void onEditerClose(EditorScreen editor)
      Called when the editor screen is closed.
      Parameters:
      editor - The instance of the EditorScreen.
    • onMouseDown

      default void onMouseDown(int x, int y)
      Called when a mouse button is pressed on the screen.
      Parameters:
      x - The x-coordinate of the mouse cursor.
      y - The y-coordinate of the mouse cursor.
    • onMouseScroll

      default void onMouseScroll()
      Called when the mouse scroll wheel is used.
    • onType

      default void onType(int keyCode, int scanCode, int modifiers)
      Called when a key is typed on the keyboard.
      Parameters:
      keyCode - The key code of the typed key.
      scanCode - The scan code of the typed key.
      modifiers - The keyboard modifiers pressed at the time of typing.
    • renderButton

      default void renderButton(DrawContext context, int mouseX, int mouseY, float delta)
      Called to render custom buttons or elements on the screen.
      Parameters:
      context - The draw context used for rendering.
      mouseX - The x-coordinate of the mouse cursor.
      mouseY - The y-coordinate of the mouse cursor.
      delta - The partial ticks for smooth rendering.