Interface ApiEntrypoint

All Known Implementing Classes:
UndoRedoEntrypoint

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.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
    The Logger that can be use for ApiEntrypoint
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Initializes the API entry point.
    default ActionResult
    onCharTyped(char charactor, int modifiers)
     
    default void
    Called when the editor screen is closed.
    default void
    Called when the editor screen is opened.
    default ActionResult
    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 ActionResult
    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.
  • Field Details

    • LOGGER

      static final org.slf4j.Logger LOGGER
      The Logger that can be use for ApiEntrypoint
      See Also:
      • Logger
  • 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 ActionResult 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 ActionResult 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.
    • onCharTyped

      default ActionResult onCharTyped(char charactor, int modifiers)
    • 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.