public interface IGuiAnimatedStat extends ITickableWidget, net.minecraft.client.gui.IGuiEventListener
IClientRegistry getAnimatedStat() methods.
Implementing your own version of animated stats is also possible.
| Modifier and Type | Method and Description |
|---|---|
void |
appendText(java.util.List<net.minecraft.util.text.ITextComponent> text)
Appends some more text to the existing text in this stat.
|
void |
closeStat()
Forces the stat to close.
|
int |
getBackgroundColor()
Get the background color of this stat.
|
int |
getBaseX() |
int |
getBaseY() |
net.minecraft.client.renderer.Rectangle2d |
getBounds()
Get a bounding box for this stat.
|
int |
getEffectiveY()
Get the effective Y position of this stat.
|
int |
getStatHeight()
Returns the Y size of this stat.
|
int |
getStatWidth()
Returns the X size of this stat.
|
net.minecraft.util.text.ITextComponent |
getTitle()
Get this stat's title line.
|
boolean |
isDoneExpanding()
Check if this stat is fully opened.
|
boolean |
isLeftSided()
Check which direction this expands to when opened.
|
boolean |
isStatOpen()
Check if the stat is currently toggled open (but not necessarily fully-open - see
isDoneExpanding()) |
void |
openStat()
Forces the stat to open.
|
void |
renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTicks)
Render the stat in 2D (gui) context.
|
void |
renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
net.minecraft.client.renderer.IRenderTypeBuffer buffer,
float partialTicks)
Render the stat in 3D (in-world) context.
|
void |
setAutoLineWrap(boolean wrap)
Enable/disable auto-line-wrapping functionality of the widget.
|
void |
setBackgroundColor(int backgroundColor)
Set the background color of this stat.
|
void |
setBaseX(int x)
Sets the x position of this stat.
|
void |
setBaseY(int y)
Sets the base Y position of this stat (see
setParentStat(IGuiAnimatedStat). |
void |
setBeveled(boolean bevel)
Should this stat be drawn with a beveled edge, or a plain edge? Default behaviour is a beveled edge
for GUI side tabs, plain edge for HUD stats.
|
void |
setForegroundColor(int foregroundColor)
Set the foreground color of this stat, which is the color used to render any text which doesn't have explicit
formatting styles.
|
void |
setLeftSided(boolean leftSided)
Set the direction this stat will expand in when opened.
|
void |
setMinimumContractedDimensions(int minWidth,
int minHeight)
Defines what dimensions the stat should have when it is not expanded (default 17x17, sufficient to display the
stat's icon) and resets the stat to these dimensions.
|
void |
setMinimumExpandedDimensions(int minWidth,
int minHeight)
Set the minimum width that this stat should expand to, even if the stat's text isn't that wide or tall.
|
void |
setParentStat(IGuiAnimatedStat stat)
When this stat gets a parent stat assigned, the effective Y position of this stat should be auto-adjusted to be
directly beneath the parent stat.
|
void |
setReservedLines(int reservedLines)
This can be used to reserve one or more lines at the top of the stat; text will only drawn below the reserved
area.
|
IGuiAnimatedStat |
setText(net.minecraft.util.text.ITextComponent text)
Sets the main text of this stat.
|
IGuiAnimatedStat |
setText(java.util.List<net.minecraft.util.text.ITextComponent> text)
Sets the main text of this stat.
|
void |
setTexture(net.minecraft.item.ItemStack itemStack)
Set the texture to use for the stat's icon
|
void |
setTexture(net.minecraft.util.ResourceLocation texture)
Set the texture to use for the stat's icon
|
void |
setTitle(net.minecraft.util.text.ITextComponent title)
Set the title line for this stat; the text drawn on the top line.
|
void |
setTitleColor(int titleColor)
Set the title color of this stat, which is the color used to render the top title line of the stat.
|
tickWidgetboolean isLeftSided()
void setLeftSided(boolean leftSided)
leftSided - true if the stat should expand to the left, false otherwiseboolean isDoneExpanding()
IGuiAnimatedStat setText(java.util.List<net.minecraft.util.text.ITextComponent> text)
text - a list of text componentsIGuiAnimatedStat setText(net.minecraft.util.text.ITextComponent text)
text - a text componentvoid appendText(java.util.List<net.minecraft.util.text.ITextComponent> text)
setText(ITextComponent)text - a list of text componentsvoid setMinimumContractedDimensions(int minWidth,
int minHeight)
minWidth - the minimum widthminHeight - the minimum heightvoid setMinimumExpandedDimensions(int minWidth,
int minHeight)
Requesting a width wider than is available (given current screen resolution), or taller than 12 lines of text, will be silently ignored, and clamped to those dimensions. The requested width does not include a 20-pixel margin for drawing a possible scrollbar, and the requested height does not include a 20 pixel margin for drawing the stat's title at the top.
minWidth - the desired width, may be 0minHeight - the desired height, may be 0void setParentStat(IGuiAnimatedStat stat)
stat - the parent statvoid setBackgroundColor(int backgroundColor)
backgroundColor - color, in ARGB formatvoid setForegroundColor(int foregroundColor)
foregroundColor - the foreground color, in ARGB formatvoid setTitleColor(int titleColor)
titleColor - the title color, in ARGB formatint getBackgroundColor()
void setBeveled(boolean bevel)
bevel - true if a beveled edge should be drawn, false otherwisevoid setBaseX(int x)
x - the X positionvoid setBaseY(int y)
setParentStat(IGuiAnimatedStat).y - the Y positionint getEffectiveY()
setParentStat(IGuiAnimatedStat). This is the
position used to render the stat, and to define the area where keyboard and mouse input is checked for.int getBaseX()
int getBaseY()
int getStatHeight()
int getStatWidth()
net.minecraft.client.renderer.Rectangle2d getBounds()
void renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTicks)
matrixStack - the matrix stackmouseX - the mouse X positionmouseY - the mouse Y positionpartialTicks - partial ticks since last client tickvoid renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
net.minecraft.client.renderer.IRenderTypeBuffer buffer,
float partialTicks)
matrixStack - the matrix stackbuffer - the render bufferpartialTicks - partial ticks since last client tickvoid closeStat()
void openStat()
boolean isStatOpen()
isDoneExpanding())void setAutoLineWrap(boolean wrap)
wrap - enablement of wrappingnet.minecraft.util.text.ITextComponent getTitle()
void setTitle(net.minecraft.util.text.ITextComponent title)
title - the title stringvoid setReservedLines(int reservedLines)
reservedLines - number of text lines to reservevoid setTexture(net.minecraft.util.ResourceLocation texture)
texture - resource location of a texture image, which should be 16x16 exactlyvoid setTexture(net.minecraft.item.ItemStack itemStack)
itemStack - an item to use for the texture