类 RenderTooltipEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.RenderTooltipEvent
public abstract class RenderTooltipEvent
extends net.minecraftforge.eventbus.api.Event
Fired during tooltip rendering.
See the various subclasses for listening to specific events.
- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static class
Fired when the tooltip background prefix is determined.static class
Fired when a tooltip gathers theTooltipComponent
s to be rendered, before any text wrapping or processing.static class
Fired before the tooltip is rendered.从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段修饰符和类型字段说明protected final List
<ClientTooltipComponent> protected Font
protected final GuiGraphics
protected final @NotNull ItemStack
protected int
protected int
-
构造器概要
构造器限定符构造器说明protected
RenderTooltipEvent
(@NotNull ItemStack itemStack, GuiGraphics graphics, int x, int y, @NotNull Font font, @NotNull List<ClientTooltipComponent> components) -
方法概要
修饰符和类型方法说明@NotNull List
<ClientTooltipComponent> 返回 the unmodifiable list of tooltip components。@NotNull Font
getFont()
返回 The font used to render the text。返回 the graphics helper for the gui。@NotNull ItemStack
返回 the item stack which the tooltip is being rendered for, or an empty item stack if there is no associated item stack。int
getX()
返回 the X position of the tooltip box。int
getY()
返回 the Y position of the tooltip box。从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
itemStack
-
graphics
-
x
protected int x -
y
protected int y -
font
-
components
-
-
构造器详细资料
-
RenderTooltipEvent
@Internal protected RenderTooltipEvent(@NotNull @NotNull ItemStack itemStack, GuiGraphics graphics, int x, int y, @NotNull @NotNull Font font, @NotNull @NotNull List<ClientTooltipComponent> components)
-
-
方法详细资料
-
getItemStack
返回 the item stack which the tooltip is being rendered for, or an empty item stack if there is no associated item stack。- 返回:
- the item stack which the tooltip is being rendered for, or an empty item stack if there is no associated item stack
-
getGraphics
返回 the graphics helper for the gui。- 返回:
- the graphics helper for the gui
-
getComponents
返回 the unmodifiable list of tooltip components。Use
ItemTooltipEvent
orRenderTooltipEvent.GatherComponents
to modify tooltip contents or components.- 返回:
- the unmodifiable list of tooltip components
-
getX
public int getX()返回 the X position of the tooltip box。 By default, this is the mouse X position.- 返回:
- the X position of the tooltip box
-
getY
public int getY()返回 the Y position of the tooltip box。 By default, this is the mouse Y position.- 返回:
- the Y position of the tooltip box
-
getFont
返回 The font used to render the text。- 返回:
- The font used to render the text
-