Package io.github.zhengzhengyiyi.addon
Class AutoBracketCompletionEntrypoint
java.lang.Object
io.github.zhengzhengyiyi.addon.AutoBracketCompletionEntrypoint
- All Implemented Interfaces:
ApiEntrypoint
This class will handle if use type bracket or other bracket like charactors.
bracketPairs.put('(', ')');
bracketPairs.put('[', ']');
bracketPairs.put('{', '}');
bracketPairs.put('"', '"');
bracketPairs.put('\'', '\'');
bracketPairs.put('`', '`');
-
Field Summary
Fields inherited from interface io.github.zhengzhengyiyi.api.ApiEntrypoint
LOGGER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit()nothing needs to init, leave as emptybooleannet.minecraft.util.ActionResultonCharTyped(char chr, int modifiers) voidonEditerClose(EditorScreen editor) Called when the editor screen is closed.voidonEditerOpen(EditorScreen editor) Called when the editor screen is opened.net.minecraft.util.ActionResultonMouseDown(int x, int y) Called when a mouse button is pressed on the screen.voidCalled when the mouse scroll wheel is used.net.minecraft.util.ActionResultonType(int keyCode, int scanCode, int modifiers) Called when a key is typed on the keyboard.voidrenderButton(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta) Called to render custom buttons or elements on the screen.voidsetEnabled(boolean enabled) void
-
Constructor Details
-
AutoBracketCompletionEntrypoint
public AutoBracketCompletionEntrypoint()
-
-
Method Details
-
init
public void init()nothing needs to init, leave as empty- Specified by:
initin interfaceApiEntrypoint
-
onEditerOpen
Description copied from interface:ApiEntrypointCalled when the editor screen is opened.- Specified by:
onEditerOpenin interfaceApiEntrypoint- Parameters:
editor- The instance of the EditorScreen.
-
onEditerClose
Description copied from interface:ApiEntrypointCalled when the editor screen is closed.- Specified by:
onEditerClosein interfaceApiEntrypoint- Parameters:
editor- The instance of the EditorScreen.
-
onMouseDown
public net.minecraft.util.ActionResult onMouseDown(int x, int y) Description copied from interface:ApiEntrypointCalled when a mouse button is pressed on the screen.- Specified by:
onMouseDownin interfaceApiEntrypoint- Parameters:
x- The x-coordinate of the mouse cursor.y- The y-coordinate of the mouse cursor.
-
onMouseScroll
public void onMouseScroll()Description copied from interface:ApiEntrypointCalled when the mouse scroll wheel is used.- Specified by:
onMouseScrollin interfaceApiEntrypoint
-
onType
public net.minecraft.util.ActionResult onType(int keyCode, int scanCode, int modifiers) Description copied from interface:ApiEntrypointCalled when a key is typed on the keyboard.- Specified by:
onTypein interfaceApiEntrypoint- 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
public net.minecraft.util.ActionResult onCharTyped(char chr, int modifiers) - Specified by:
onCharTypedin interfaceApiEntrypoint
-
renderButton
public void renderButton(net.minecraft.client.gui.DrawContext context, int mouseX, int mouseY, float delta) Description copied from interface:ApiEntrypointCalled to render custom buttons or elements on the screen.- Specified by:
renderButtonin interfaceApiEntrypoint- 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.
-
setEnabled
public void setEnabled(boolean enabled) -
isEnabled
public boolean isEnabled() -
toggleEnabled
public void toggleEnabled()
-