Package io.github.zhengzhengyiyi.api
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 TypeMethodDescriptionvoidinit()Initializes the API entry point.default voidonEditerClose(EditorScreen editor) Called when the editor screen is closed.default voidonEditerOpen(EditorScreen editor) Called when the editor screen is opened.default voidonMouseDown(int x, int y) Called when a mouse button is pressed on the screen.default voidCalled when the mouse scroll wheel is used.default voidonType(int keyCode, int scanCode, int modifiers) Called when a key is typed on the keyboard.default voidrenderButton(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
Called when the editor screen is opened.- Parameters:
editor- The instance of the EditorScreen.
-
onEditerClose
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
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.
-