public class WidgetAnimatedStat extends net.minecraft.client.gui.widget.Widget implements IGuiAnimatedStat, ITooltipProvider
| Modifier and Type | Class and Description |
|---|---|
static class |
WidgetAnimatedStat.StatIcon |
| Constructor and Description |
|---|
WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
int backgroundColor) |
WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
int backgroundColor,
net.minecraft.item.ItemStack icon) |
WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
int backgroundColor,
net.minecraft.util.ResourceLocation texture) |
WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
net.minecraft.util.text.ITextComponent title,
int xPos,
int yPos,
int backGroundColor,
IGuiAnimatedStat statAbove,
boolean leftSided) |
WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
net.minecraft.util.text.ITextComponent title,
WidgetAnimatedStat.StatIcon icon,
int backGroundColor,
IGuiAnimatedStat statAbove,
ArmorHUDLayout.LayoutItem layout) |
WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
net.minecraft.util.text.ITextComponent title,
WidgetAnimatedStat.StatIcon icon,
int xPos,
int yPos,
int backGroundColor,
IGuiAnimatedStat statAbove,
boolean leftSided) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSubWidget(net.minecraft.client.gui.widget.Widget widget) |
void |
addTooltip(double mouseX,
double mouseY,
java.util.List<net.minecraft.util.text.ITextComponent> curTooltip,
boolean shiftPressed) |
void |
appendText(java.util.List<net.minecraft.util.text.ITextComponent> text)
Appends some more text to the existing text in this stat.
|
boolean |
charTyped(char codePoint,
int modifiers) |
protected boolean |
clicked(double mouseX,
double mouseY) |
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 |
isMouseOver(double mouseX,
double mouseY) |
boolean |
isStatOpen()
Check if the stat is currently toggled open (but not necessarily fully-open - see
IGuiAnimatedStat.isDoneExpanding()) |
boolean |
keyPressed(int keyCode,
int scanCode,
int modifiers) |
boolean |
mouseClicked(double mouseX,
double mouseY,
int button) |
boolean |
mouseDragged(double mouseX,
double mouseY,
int button,
double dragX,
double dragY) |
boolean |
mouseReleased(double mouseX,
double mouseY,
int button) |
boolean |
mouseScrolled(double x,
double y,
double dir) |
void |
openStat()
Forces the stat to open.
|
void |
removeSubWidget(net.minecraft.client.gui.widget.Widget widget) |
void |
renderButton(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTicks) |
void |
renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int x,
int y,
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
IGuiAnimatedStat.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 |
setExtraTooltipText(java.util.List<net.minecraft.util.text.ITextComponent> extraTooltipText) |
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 |
setLineSpacing(int lineSpacing) |
void |
setMessage(net.minecraft.util.text.ITextComponent message) |
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.
|
void |
setSubwidgetRenderOffsets(int left,
int right) |
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.
|
void |
tickWidget()
Called each tick by the
Screen.tick() method. |
changeFocus, clearFGColor, createNarrationMessage, getFGColor, getHeight, getMessage, getWidth, getYImage, isFocused, isHovered, isValidClickButton, narrate, onClick, onDrag, onFocusedChanged, onRelease, playDownSound, queueNarration, render, renderBg, renderToolTip, setAlpha, setFGColor, setFocused, setHeight, setWidthblit, blit, blit, blit, blit, blitOutlineBlack, drawCenteredString, drawCenteredString, drawString, drawString, fill, fillGradient, fillGradient, getBlitOffset, hLine, setBlitOffset, vLinepublic WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
net.minecraft.util.text.ITextComponent title,
int xPos,
int yPos,
int backGroundColor,
IGuiAnimatedStat statAbove,
boolean leftSided)
public WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
int backgroundColor)
public WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
int backgroundColor,
net.minecraft.item.ItemStack icon)
public WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
int backgroundColor,
net.minecraft.util.ResourceLocation texture)
public WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
net.minecraft.util.text.ITextComponent title,
WidgetAnimatedStat.StatIcon icon,
int xPos,
int yPos,
int backGroundColor,
IGuiAnimatedStat statAbove,
boolean leftSided)
public WidgetAnimatedStat(net.minecraft.client.gui.screen.Screen gui,
net.minecraft.util.text.ITextComponent title,
WidgetAnimatedStat.StatIcon icon,
int backGroundColor,
IGuiAnimatedStat statAbove,
ArmorHUDLayout.LayoutItem layout)
public void setMessage(net.minecraft.util.text.ITextComponent message)
setMessage in class net.minecraft.client.gui.widget.Widgetpublic void setParentStat(IGuiAnimatedStat stat)
IGuiAnimatedStatsetParentStat in interface IGuiAnimatedStatstat - the parent statpublic void addSubWidget(net.minecraft.client.gui.widget.Widget widget)
public void removeSubWidget(net.minecraft.client.gui.widget.Widget widget)
public void setSubwidgetRenderOffsets(int left,
int right)
public boolean isLeftSided()
IGuiAnimatedStatisLeftSided in interface IGuiAnimatedStatpublic void setLeftSided(boolean leftSided)
IGuiAnimatedStatsetLeftSided in interface IGuiAnimatedStatleftSided - true if the stat should expand to the left, false otherwisepublic void setAutoLineWrap(boolean wrap)
IGuiAnimatedStatsetAutoLineWrap in interface IGuiAnimatedStatwrap - enablement of wrappingpublic net.minecraft.util.text.ITextComponent getTitle()
IGuiAnimatedStatgetTitle in interface IGuiAnimatedStatpublic void setTitle(net.minecraft.util.text.ITextComponent title)
IGuiAnimatedStatsetTitle in interface IGuiAnimatedStattitle - the title stringpublic IGuiAnimatedStat setText(java.util.List<net.minecraft.util.text.ITextComponent> text)
IGuiAnimatedStatsetText in interface IGuiAnimatedStattext - a list of text componentspublic IGuiAnimatedStat setText(net.minecraft.util.text.ITextComponent text)
IGuiAnimatedStatsetText in interface IGuiAnimatedStattext - a text componentpublic void appendText(java.util.List<net.minecraft.util.text.ITextComponent> text)
IGuiAnimatedStatIGuiAnimatedStat.setText(ITextComponent)appendText in interface IGuiAnimatedStattext - a list of text componentspublic void setBackgroundColor(int backgroundColor)
IGuiAnimatedStatsetBackgroundColor in interface IGuiAnimatedStatbackgroundColor - color, in ARGB formatpublic void setForegroundColor(int foregroundColor)
IGuiAnimatedStatsetForegroundColor in interface IGuiAnimatedStatforegroundColor - the foreground color, in ARGB formatpublic void setTitleColor(int titleColor)
IGuiAnimatedStatsetTitleColor in interface IGuiAnimatedStattitleColor - the title color, in ARGB formatpublic int getBackgroundColor()
IGuiAnimatedStatgetBackgroundColor in interface IGuiAnimatedStatpublic void setBeveled(boolean bevel)
IGuiAnimatedStatsetBeveled in interface IGuiAnimatedStatbevel - true if a beveled edge should be drawn, false otherwisepublic void setReservedLines(int reservedLines)
IGuiAnimatedStatsetReservedLines in interface IGuiAnimatedStatreservedLines - number of text lines to reservepublic void setMinimumContractedDimensions(int minWidth,
int minHeight)
IGuiAnimatedStatsetMinimumContractedDimensions in interface IGuiAnimatedStatminWidth - the minimum widthminHeight - the minimum heightpublic void setMinimumExpandedDimensions(int minWidth,
int minHeight)
IGuiAnimatedStatRequesting 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.
setMinimumExpandedDimensions in interface IGuiAnimatedStatminWidth - the desired width, may be 0minHeight - the desired height, may be 0public void tickWidget()
ITickableWidgetScreen.tick() method.tickWidget in interface ITickableWidgetpublic void renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int x,
int y,
float partialTicks)
IGuiAnimatedStatrenderStat in interface IGuiAnimatedStatmatrixStack - the matrix stackx - the mouse X positiony - the mouse Y positionpartialTicks - partial ticks since last client tickprotected boolean clicked(double mouseX,
double mouseY)
clicked in class net.minecraft.client.gui.widget.Widgetpublic void renderButton(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
int mouseX,
int mouseY,
float partialTicks)
renderButton in class net.minecraft.client.gui.widget.Widgetpublic void renderStat(com.mojang.blaze3d.matrix.MatrixStack matrixStack,
net.minecraft.client.renderer.IRenderTypeBuffer buffer,
float partialTicks)
IGuiAnimatedStatrenderStat in interface IGuiAnimatedStatmatrixStack - the matrix stackbuffer - the render bufferpartialTicks - partial ticks since last client tickpublic boolean isMouseOver(double mouseX,
double mouseY)
isMouseOver in interface net.minecraft.client.gui.IGuiEventListenerisMouseOver in class net.minecraft.client.gui.widget.Widgetpublic boolean mouseClicked(double mouseX,
double mouseY,
int button)
mouseClicked in interface net.minecraft.client.gui.IGuiEventListenermouseClicked in class net.minecraft.client.gui.widget.Widgetpublic boolean mouseReleased(double mouseX,
double mouseY,
int button)
mouseReleased in interface net.minecraft.client.gui.IGuiEventListenermouseReleased in class net.minecraft.client.gui.widget.Widgetpublic boolean mouseDragged(double mouseX,
double mouseY,
int button,
double dragX,
double dragY)
mouseDragged in interface net.minecraft.client.gui.IGuiEventListenermouseDragged in class net.minecraft.client.gui.widget.Widgetpublic boolean mouseScrolled(double x,
double y,
double dir)
mouseScrolled in interface net.minecraft.client.gui.IGuiEventListenerpublic boolean keyPressed(int keyCode,
int scanCode,
int modifiers)
keyPressed in interface net.minecraft.client.gui.IGuiEventListenerpublic boolean charTyped(char codePoint,
int modifiers)
charTyped in interface net.minecraft.client.gui.IGuiEventListenerpublic void closeStat()
IGuiAnimatedStatcloseStat in interface IGuiAnimatedStatpublic void openStat()
IGuiAnimatedStatopenStat in interface IGuiAnimatedStatpublic boolean isStatOpen()
IGuiAnimatedStatIGuiAnimatedStat.isDoneExpanding())isStatOpen in interface IGuiAnimatedStatpublic int getEffectiveY()
IGuiAnimatedStatIGuiAnimatedStat.setParentStat(IGuiAnimatedStat). This is the
position used to render the stat, and to define the area where keyboard and mouse input is checked for.getEffectiveY in interface IGuiAnimatedStatpublic int getBaseX()
getBaseX in interface IGuiAnimatedStatpublic int getBaseY()
getBaseY in interface IGuiAnimatedStatpublic int getStatHeight()
IGuiAnimatedStatgetStatHeight in interface IGuiAnimatedStatpublic int getStatWidth()
IGuiAnimatedStatgetStatWidth in interface IGuiAnimatedStatpublic void setBaseY(int y)
IGuiAnimatedStatIGuiAnimatedStat.setParentStat(IGuiAnimatedStat).setBaseY in interface IGuiAnimatedStaty - the Y positionpublic void setBaseX(int x)
IGuiAnimatedStatsetBaseX in interface IGuiAnimatedStatx - the X positionpublic boolean isDoneExpanding()
IGuiAnimatedStatisDoneExpanding in interface IGuiAnimatedStatpublic net.minecraft.client.renderer.Rectangle2d getBounds()
IGuiAnimatedStatgetBounds in interface IGuiAnimatedStatpublic void addTooltip(double mouseX,
double mouseY,
java.util.List<net.minecraft.util.text.ITextComponent> curTooltip,
boolean shiftPressed)
addTooltip in interface ITooltipProviderpublic void setExtraTooltipText(java.util.List<net.minecraft.util.text.ITextComponent> extraTooltipText)
public void setLineSpacing(int lineSpacing)
public void setTexture(net.minecraft.util.ResourceLocation texture)
IGuiAnimatedStatsetTexture in interface IGuiAnimatedStattexture - resource location of a texture image, which should be 16x16 exactlypublic void setTexture(net.minecraft.item.ItemStack itemStack)
IGuiAnimatedStatsetTexture in interface IGuiAnimatedStatitemStack - an item to use for the texture