Package io.github.zhengzhengyiyi.api
Interface ApiEntrypoint
- All Known Implementing Classes:
AutoBracketCompletionEntrypoint,DateTimeDisplayEntrypoint,TextStatsEntrypoint,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
FieldsModifier and TypeFieldDescriptionstatic final org.slf4j.LoggerThe Logger that can be use for ApiEntrypoint -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()Initializes the API entry point.default net.minecraft.util.ActionResultonCharTyped(char charactor, int modifiers) default voidonEditerClose(EditorScreen editor) Called when the editor screen is closed.default voidonEditerOpen(EditorScreen editor) Called when the editor screen is opened.default net.minecraft.util.ActionResultonMouseDown(int x, int y) Called when a mouse button is pressed on the screen.default voidCalled when the mouse scroll wheel is used.default net.minecraft.util.ActionResultonType(int keyCode, int scanCode, int modifiers) Called when a key is typed on the keyboard.default voidrenderButton(net.minecraft.client.gui.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 LOGGERThe Logger that can be use for ApiEntrypoint- See Also:
-
-
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 net.minecraft.util.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 net.minecraft.util.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 net.minecraft.util.ActionResult onCharTyped(char charactor, int modifiers) -
renderButton
default void renderButton(net.minecraft.client.gui.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.
-