Interface IScreenAddon
- All Superinterfaces:
net.minecraft.client.gui.components.events.GuiEventListener,net.minecraft.client.gui.components.TabOrderedElement
- All Known Implementing Classes:
ArrowButtonScreenAddon,AssetScreenAddon,BasicButtonAddon,BasicScreenAddon,ColorPickerAddon,DragPanelScreenAddon,EnergyBarScreenAddon,FacingHandlerScreenAddon,HuePickerAddon,ItemstackFilterScreenAddon,LockableOverlayAddon,ProgressBarScreenAddon,ShadePickerAddon,SlotsScreenAddon,StateButtonAddon,TankScreenAddon,TextFieldScreenAddon,TextScreenAddon,WidgetScreenAddon
public interface IScreenAddon
extends net.minecraft.client.gui.components.events.GuiEventListener
-
Field Summary
Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
DOUBLE_CLICK_THRESHOLD_MS -
Method Summary
Modifier and TypeMethodDescriptiondefault booleancharTyped(char codePoint, int modifiers) Called when a specific 'Character' is typedvoiddrawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks) Draws the component in the background layervoiddrawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks) Draws the component in the foreground layerdefault List<net.minecraft.network.chat.Component>A list of strings that will be drawn as a tooltip when `isInside` returns truedefault voidinit(int screenX, int screenY) Called when init is called in the screen.default booleanbooleandefault booleanisMouseOver(double mouseX, double mouseY) Checks whether the mouse if over a specific object or pointdefault booleankeyPressed(int keyCode, int scanCode, int modifiers) Called when a key is presseddefault booleankeyReleased(int keyCode, int scanCode, int modifiers) Called when a key is presseddefault booleanmouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clickeddefault booleanmouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is pressed and draggeddefault voidmouseMoved(double xPos, double yPos) Called when the mouse is moved.default booleanmouseReleased(double mouseX, double mouseY, int button) Called when the mouse button is releaseddefault booleanmouseScrolled(double mouseX, double mouseY, double delta) Called when mouse scroll is appliedvoidsetFocused(boolean focus) Called when Screen Focus changesMethods inherited from interface net.minecraft.client.gui.components.events.GuiEventListener
getCurrentFocusPath, getRectangle, nextFocusPathMethods inherited from interface net.minecraft.client.gui.components.TabOrderedElement
getTabOrderGroup
-
Method Details
-
drawBackgroundLayer
void drawBackgroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks) Draws the component in the background layer- Parameters:
guiGraphics-screen- The current open screenprovider- The current asset provider used in the GUIguiX- The gui X in the top left cornerguiY- The gui Y in the top left cornermouseX- The current mouse XmouseY- The current mouse YpartialTicks- Partial ticks
-
drawForegroundLayer
void drawForegroundLayer(net.minecraft.client.gui.GuiGraphics guiGraphics, net.minecraft.client.gui.screens.Screen screen, IAssetProvider provider, int guiX, int guiY, int mouseX, int mouseY, float partialTicks) Draws the component in the foreground layer- Parameters:
guiGraphics-screen- The current open screenprovider- The current asset provider used in the GUIguiX- The gui X in the top left cornerguiY- The gui Y in the top left cornermouseX- The current mouse XmouseY- The current mouse YpartialTicks- Partial Ticks
-
getTooltipLines
A list of strings that will be drawn as a tooltip when `isInside` returns true- Returns:
- Returns a list of tooltip lines represented as
Component's
-
init
default void init(int screenX, int screenY) Called when init is called in the screen.- Parameters:
screenX- the left point of the ScreenscreenY- the top point of the Screen
-
isBackground
default boolean isBackground()- Returns:
- Returns true if the addon is part of the background, background rendering.
-
mouseMoved
default void mouseMoved(double xPos, double yPos) Called when the mouse is moved.- Specified by:
mouseMovedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
xPos- Current mouse coordinate XyPos- Current mouse coordinate Y
-
mouseClicked
default boolean mouseClicked(double mouseX, double mouseY, int button) Called when a mouse button is clicked- Specified by:
mouseClickedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
mouseX- The mouse X coordinate where it was clickedmouseY- The mouse Y coordinate where it was clickedbutton- The Id of the button that was clicked- Returns:
- Returns whether the mouse was clicked successfully or not
-
mouseReleased
default boolean mouseReleased(double mouseX, double mouseY, int button) Called when the mouse button is released- Specified by:
mouseReleasedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
mouseX- The Mouse's X coordinate where it was releasedmouseY- The Mouse's Y coordinate where it was releasedbutton- The Id of the mouse button that was released- Returns:
- Returns true if the mouse button release was handled
-
mouseDragged
default boolean mouseDragged(double mouseX, double mouseY, int button, double dragX, double dragY) Called when the mouse is pressed and dragged- Specified by:
mouseDraggedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
mouseX- The X coordinate of the mouse where the drag was initiatedmouseY- The Y coordinate of the mouse where the drag was initiatedbutton- The Id of the Button that was presseddragX- The X coordinate of the mouse where the drag was finisheddragY- The Y coordinate of the mouse where the drag was finished- Returns:
- Returns true if the drag was handled
-
mouseScrolled
default boolean mouseScrolled(double mouseX, double mouseY, double delta) Called when mouse scroll is applied- Specified by:
mouseScrolledin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
mouseX- The X coordinate of the mouse where the scroll was initiatedmouseY- The Y coordinate of the mouse where the scroll was initiateddelta- The scroll wheel delta (Change rate)- Returns:
- Returns true if the scroll was handled
-
keyPressed
default boolean keyPressed(int keyCode, int scanCode, int modifiers) Called when a key is pressed- Specified by:
keyPressedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
keyCode- The keyboard key that was pressed or releasedscanCode- The system-specific scancode of the keymodifiers- The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)- Returns:
- Returns true if the key press was handled
-
keyReleased
default boolean keyReleased(int keyCode, int scanCode, int modifiers) Called when a key is pressed- Specified by:
keyReleasedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
keyCode- The keyboard key that was pressed or releasedscanCode- The system-specific scancode of the keymodifiers- The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)- Returns:
- Returns whether the key release was handled
-
charTyped
default boolean charTyped(char codePoint, int modifiers) Called when a specific 'Character' is typed- Specified by:
charTypedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
codePoint- The Unicode code point of the charactermodifiers- The 'bitfield' describing which modifiers keys were held down (ctrl, alt, shift, etc)- Returns:
- Returns true if the 'Character' being typed was handled
-
isFocused
boolean isFocused()- Specified by:
isFocusedin interfacenet.minecraft.client.gui.components.events.GuiEventListener
-
setFocused
void setFocused(boolean focus) Called when Screen Focus changes- Specified by:
setFocusedin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
focus- If the screen the addon is part of is focused
-
isMouseOver
default boolean isMouseOver(double mouseX, double mouseY) Checks whether the mouse if over a specific object or point- Specified by:
isMouseOverin interfacenet.minecraft.client.gui.components.events.GuiEventListener- Parameters:
mouseX- The X position of the mousemouseY- The Y position of the mouse- Returns:
- Returns true if the mouse if over a specific object or point
-