public abstract class RenderTooltipEvent extends Event
Can be used to change the rendering parameters, draw something extra, etc.
Do not use this event directly, use one of the subclasses:
Modifier and Type | Class and Description |
---|---|
protected static class |
RenderTooltipEvent.Post
Events inheriting from this class are fired at different stages during the tooltip rendering.
|
static class |
RenderTooltipEvent.PostBackground
This event is fired directly after the tooltip background is drawn, but before any text is drawn.
|
static class |
RenderTooltipEvent.PostText
This event is fired directly after the tooltip text is drawn, but before the GL state is reset.
|
static class |
RenderTooltipEvent.Pre
This event is fired before any tooltip calculations are done.
|
Event.HasResult, Event.Result
Modifier and Type | Field and Description |
---|---|
protected FontRenderer |
fr |
protected java.util.List<java.lang.String> |
lines |
protected ItemStack |
stack |
protected int |
x |
protected int |
y |
Constructor and Description |
---|
RenderTooltipEvent(ItemStack stack,
java.util.List<java.lang.String> lines,
int x,
int y,
FontRenderer fr) |
Modifier and Type | Method and Description |
---|---|
FontRenderer |
getFontRenderer() |
java.util.List<java.lang.String> |
getLines()
The lines to be drawn.
|
ItemStack |
getStack() |
int |
getX() |
int |
getY() |
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
@Nonnull protected final ItemStack stack
protected final java.util.List<java.lang.String> lines
protected int x
protected int y
protected FontRenderer fr
public RenderTooltipEvent(@Nonnull ItemStack stack, @Nonnull java.util.List<java.lang.String> lines, int x, int y, @Nonnull FontRenderer fr)
@Nonnull public ItemStack getStack()
@Nonnull public java.util.List<java.lang.String> getLines()
RenderTooltipEvent.Pre
and RenderTooltipEvent.Post
.ItemTooltipEvent
to modify tooltip text.public int getX()
public int getY()
@Nonnull public FontRenderer getFontRenderer()
FontRenderer
instance the current render is using.