Package mcp.mobius.waila.api
Interface IEventListener
Used to listen to generic Waila events.
Register implementations with IClientRegistrar.eventListener(mcp.mobius.waila.api.IEventListener, int)
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiongetHoveredItemModName(ItemStack stack, IPluginConfig config) This event is fired when item tooltip is displayed on container screen and waila showing the item's mod name.default voidonAfterTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config) This event is fired just after the tooltip is rendered.default voidonBeforeTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config, IEventListener.Canceller canceller) This event is fired just before the tooltip is rendered.default voidonHandleTooltip(ITooltip tooltip, ICommonAccessor accessor, IPluginConfig config) This event is fired just before the tooltip size is calculated.default voidonTick(IPluginConfig config) This event is fired on every tick, before Waila handle anything, regardless whether the tooltip will be shown or not.
-
Method Details
-
onTick
This event is fired on every tick, before Waila handle anything, regardless whether the tooltip will be shown or not. -
onHandleTooltip
This event is fired just before the tooltip size is calculated. This is the last chance to make edits to the information being displayed. -
onBeforeTooltipRender
default void onBeforeTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config, IEventListener.Canceller canceller) This event is fired just before the tooltip is rendered.- Parameters:
rect- the position and dimension of the tooltip, you can modify this to transform the tooltipcanceller- callIEventListener.Canceller.cancel()to cancel this event, if canceled, the tooltip will not render
-
onAfterTooltipRender
default void onAfterTooltipRender(GuiGraphics ctx, Rectangle rect, ICommonAccessor accessor, IPluginConfig config) This event is fired just after the tooltip is rendered.- Parameters:
rect- the position and dimension of the tooltip
-
getHoveredItemModName
This event is fired when item tooltip is displayed on container screen and waila showing the item's mod name.- Returns:
- null if this listener doesn't decide the name, otherwise return a string
-