Package net.minecraft.client.gui
Class GuiGraphics
java.lang.Object
net.minecraft.client.gui.GuiGraphics
- All Implemented Interfaces:
IGuiGraphicsExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classA utility class for managing a stack of screen rectangles for scissoring. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MultiBufferSource.BufferSourceprivate static final intprivate booleanstatic final floatstatic final floatprivate final Minecraftprivate final PoseStackprivate final GuiGraphics.ScissorStackprivate final GuiSpriteManagerprivate ItemStackFields inherited from interface net.neoforged.neoforge.client.extensions.IGuiGraphicsExtension
DEFAULT_BACKGROUND_COLOR, DEFAULT_BORDER_COLOR_END, DEFAULT_BORDER_COLOR_START, INVALID, RESET_CHAR, TEXT_COLOR_CODES, UNDO_CHAR, VALID -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateGuiGraphics(Minecraft minecraft, PoseStack pose, MultiBufferSource.BufferSource bufferSource) GuiGraphics(Minecraft minecraft, MultiBufferSource.BufferSource bufferSource) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidapplyScissor(ScreenRectangle rectangle) Applies scissoring based on the provided screen rectangle.voidblit(int x, int y, int blitOffset, int width, int height, TextureAtlasSprite sprite) Blits a portion of the specified texture atlas sprite onto the screen at the given coordinates.voidblit(int x, int y, int blitOffset, int width, int height, TextureAtlasSprite sprite, float red, float green, float blue, float alpha) Blits a portion of the specified texture atlas sprite onto the screen at the given coordinates with a color tint.voidblit(ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int width, int height, int textureWidth, int textureHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given position and dimensions with texture coordinates.voidblit(ResourceLocation atlasLocation, int x, int y, int blitOffset, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given coordinates with a blit offset and texture coordinates.voidblit(ResourceLocation atlasLocation, int x, int y, int width, int height, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given position and dimensions with texture coordinates.voidblit(ResourceLocation atlasLocation, int x, int y, int uOffset, int vOffset, int uWidth, int vHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given coordinates.(package private) voidblit(ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, int blitOffset, int uWidth, int vHeight, float uOffset, float vOffset, int textureWidth, int textureHeight) Performs the inner blit operation for rendering a texture with the specified coordinates and texture coordinates.private voidblitNineSlicedSprite(TextureAtlasSprite sprite, GuiSpriteScaling.NineSlice nineSlice, int x, int y, int blitOffset, int width, int height) private voidblitSprite(TextureAtlasSprite sprite, int x, int y, int blitOffset, int width, int height) private voidblitSprite(TextureAtlasSprite sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int blitOffset, int uWidth, int vHeight) voidblitSprite(ResourceLocation sprite, int x, int y, int width, int height) voidblitSprite(ResourceLocation sprite, int x, int y, int blitOffset, int width, int height) voidblitSprite(ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight) voidblitSprite(ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int blitOffset, int uWidth, int vHeight) private voidblitTiledSprite(TextureAtlasSprite sprite, int x, int y, int blitOffset, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight) booleancontainsPointInScissor(int x, int y) voidvoiddrawCenteredString(Font font, String text, int x, int y, int color) Draws a centered string at the specified coordinates using the given font, text, and color.voiddrawCenteredString(Font font, Component text, int x, int y, int color) Draws a centered string at the specified coordinates using the given font, text component, and color.voiddrawCenteredString(Font font, FormattedCharSequence text, int x, int y, int color) Draws a centered string at the specified coordinates using the given font, formatted character sequence, and color.voiddrawManaged(Runnable runnable) Deprecated.intdrawString(Font p_283343_, String p_281896_, float p_283569_, float p_283418_, int p_281560_, boolean p_282130_) intdrawString(Font font, String text, int x, int y, int color) Draws a string at the specified coordinates using the given font, text, and color.intdrawString(Font font, String text, int x, int y, int color, boolean dropShadow) Draws a string at the specified coordinates using the given font, text, color, and drop shadow.intdrawString(Font font, Component text, int x, int y, int color) Draws a component's visual order text at the specified coordinates using the given font, text component, and color.intdrawString(Font font, Component text, int x, int y, int color, boolean dropShadow) Draws a component's visual order text at the specified coordinates using the given font, text component, color, and drop shadow.intdrawString(Font p_282636_, FormattedCharSequence p_281596_, float p_281586_, float p_282816_, int p_281743_, boolean p_282394_) intdrawString(Font font, FormattedCharSequence text, int x, int y, int color) Draws a formatted character sequence at the specified coordinates using the given font, text, and color.intdrawString(Font font, FormattedCharSequence text, int x, int y, int color, boolean dropShadow) Draws a formatted character sequence at the specified coordinates using the given font, text, color, and drop shadow.intdrawStringWithBackdrop(Font font, Component text, int x, int y, int xOffset, int color) voiddrawWordWrap(Font font, FormattedText text, int x, int y, int lineWidth, int color) Draws a formatted text with word wrapping at the specified coordinates using the given font, text, line width, and color.voidenableScissor(int minX, int minY, int maxX, int maxY) Enables scissoring with the specified screen coordinates.voidfill(int minX, int minY, int maxX, int maxY, int color) Fills a rectangle with the specified color using the given coordinates as the boundaries.voidfill(int minX, int minY, int maxX, int maxY, int z, int color) Fills a rectangle with the specified color and z-level using the given coordinates as the boundaries.voidfill(RenderType renderType, int minX, int minY, int maxX, int maxY, int color) Fills a rectangle with the specified color using the given render type and coordinates as the boundaries.voidfill(RenderType renderType, int minX, int minY, int maxX, int maxY, int z, int color) Fills a rectangle with the specified color and z-level using the given render type and coordinates as the boundaries.voidfillGradient(int x1, int y1, int x2, int y2, int colorFrom, int colorTo) Fills a rectangle with a gradient color from colorFrom to colorTo using the given coordinates as the boundaries.voidfillGradient(int x1, int y1, int x2, int y2, int z, int colorFrom, int colorTo) Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given coordinates as the boundaries.private voidfillGradient(VertexConsumer consumer, int x1, int y1, int x2, int y2, int z, int colorFrom, int colorTo) The core `fillGradient` method.voidfillGradient(RenderType renderType, int x1, int y1, int x2, int y2, int colorFrom, int colorTo, int z) Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given render type and coordinates as the boundaries.voidfillRenderType(RenderType renderType, int x1, int y1, int x2, int y2, int z) voidflush()private voidDeprecated.private voidDeprecated.intintguiWidth()voidhLine(int minX, int maxX, int y, int color) Draws a horizontal line from minX to maxX at the specified y-coordinate with the given color.voidhLine(RenderType renderType, int minX, int maxX, int y, int color) Draws a horizontal line from minX to maxX at the specified y-coordinate with the given color using the specified render type.(package private) voidinnerBlit(ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, int blitOffset, float minU, float maxU, float minV, float maxV) Performs the inner blit operation for rendering a texture with the specified coordinates and texture coordinates without color tinting.(package private) voidinnerBlit(ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, int blitOffset, float minU, float maxU, float minV, float maxV, float red, float green, float blue, float alpha) Performs the inner blit operation for rendering a texture with the specified coordinates, texture coordinates, and color tint.pose()voidrenderComponentHoverEffect(Font font, Style style, int mouseX, int mouseY) Renders a hover effect for a text component at the specified mouse coordinates.voidrenderComponentTooltip(Font p_font, List<? extends FormattedText> tooltipLines, int p_mouseX, int p_mouseY, ItemStack stack) Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.voidrenderComponentTooltip(Font font, List<Component> tooltipLines, int mouseX, int mouseY) Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.voidrenderComponentTooltipFromElements(Font font, List<com.mojang.datafixers.util.Either<FormattedText, TooltipComponent>> elements, int mouseX, int mouseY, ItemStack stack) voidrenderFakeItem(ItemStack stack, int x, int y) Renders a fake item stack at the specified coordinates.voidrenderFakeItem(ItemStack stack, int x, int y, int seed) voidrenderItem(LivingEntity entity, ItemStack stack, int x, int y, int seed) Renders an item stack for a living entity at the specified coordinates with a random seed.private voidrenderItem(LivingEntity entity, Level level, ItemStack stack, int x, int y, int seed) Renders an item stack for a living entity in a specific level at the specified coordinates with a random seed.private voidrenderItem(LivingEntity entity, Level level, ItemStack stack, int x, int y, int seed, int guiOffset) Renders an item stack for a living entity in a specific level at the specified coordinates with a random seed and a custom GUI offset.voidrenderItem(ItemStack stack, int x, int y) Renders an item stack at the specified coordinates.voidrenderItem(ItemStack stack, int x, int y, int seed) Renders an item stack at the specified coordinates with a random seed.voidrenderItem(ItemStack stack, int x, int y, int seed, int guiOffset) Renders an item stack at the specified coordinates with a random seed and a custom value.voidrenderItemDecorations(Font font, ItemStack stack, int x, int y) Renders additional decorations for an item stack at the specified coordinates.voidrenderItemDecorations(Font font, ItemStack stack, int x, int y, String text) Renders additional decorations for an item stack at the specified coordinates with optional custom text.voidrenderOutline(int x, int y, int width, int height, int color) Renders an outline rectangle on the screen with the specified color.voidrenderTooltip(Font font, List<? extends FormattedCharSequence> tooltipLines, int mouseX, int mouseY) Renders a tooltip with multiple lines of formatted text at the specified mouse coordinates.voidrenderTooltip(Font font, List<Component> tooltipLines, Optional<TooltipComponent> visualTooltipComponent, int mouseX, int mouseY) Renders a tooltip with customizable components at the specified mouse coordinates.voidrenderTooltip(Font font, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, ItemStack stack, int mouseX, int mouseY) voidrenderTooltip(Font font, List<FormattedCharSequence> tooltipLines, ClientTooltipPositioner tooltipPositioner, int mouseX, int mouseY) Renders a tooltip with multiple lines of formatted text using a custom tooltip positioner at the specified mouse coordinates.voidrenderTooltip(Font font, Component text, int mouseX, int mouseY) Renders a tooltip with a single line of text at the specified mouse coordinates.voidrenderTooltip(Font font, ItemStack stack, int mouseX, int mouseY) Renders a tooltip for an item stack at the specified mouse coordinates.private voidrenderTooltipInternal(Font font, List<ClientTooltipComponent> components, int mouseX, int mouseY, ClientTooltipPositioner tooltipPositioner) Renders an internal tooltip with customizable tooltip components at the specified mouse coordinates using a tooltip positioner.voidsetColor(float red, float green, float blue, float alpha) Sets the current rendering color.voidvLine(int x, int minY, int maxY, int color) Draws a vertical line from minY to maxY at the specified x-coordinate with the given color.voidvLine(RenderType renderType, int x, int minY, int maxY, int color) Draws a vertical line from minY to maxY at the specified x-coordinate with the given color using the specified render type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.client.extensions.IGuiGraphicsExtension
blitInscribed, blitInscribed, blitWithBorder, blitWithBorder, drawScrollingString, getColorFromFormattingCharacter
-
Field Details
-
MAX_GUI_Z
public static final float MAX_GUI_Z- See Also:
-
MIN_GUI_Z
public static final float MIN_GUI_Z- See Also:
-
EXTRA_SPACE_AFTER_FIRST_TOOLTIP_LINE
private static final int EXTRA_SPACE_AFTER_FIRST_TOOLTIP_LINE- See Also:
-
minecraft
-
pose
-
bufferSource
-
scissorStack
-
sprites
-
managed
private boolean managed -
tooltipStack
-
-
Constructor Details
-
GuiGraphics
private GuiGraphics(Minecraft minecraft, PoseStack pose, MultiBufferSource.BufferSource bufferSource) -
GuiGraphics
-
-
Method Details
-
drawManaged
Deprecated.Executes a runnable while managing the render state. The render state is flushed before and after executing the runnable.- Parameters:
runnable- the runnable to execute.
-
flushIfUnmanaged
Deprecated. -
flushIfManaged
Deprecated. -
guiWidth
public int guiWidth() -
guiHeight
public int guiHeight() -
pose
-
bufferSource
-
flush
public void flush() -
hLine
public void hLine(int minX, int maxX, int y, int color) Draws a horizontal line from minX to maxX at the specified y-coordinate with the given color.- Parameters:
minX- the x-coordinate of the start point.maxX- the x-coordinate of the end point.y- the y-coordinate of the line.color- the color of the line.
-
hLine
Draws a horizontal line from minX to maxX at the specified y-coordinate with the given color using the specified render type.- Parameters:
renderType- the render type to use.minX- the x-coordinate of the start point.maxX- the x-coordinate of the end point.y- the y-coordinate of the line.color- the color of the line.
-
vLine
public void vLine(int x, int minY, int maxY, int color) Draws a vertical line from minY to maxY at the specified x-coordinate with the given color.- Parameters:
x- the x-coordinate of the line.minY- the y-coordinate of the start point.maxY- the y-coordinate of the end point.color- the color of the line.
-
vLine
Draws a vertical line from minY to maxY at the specified x-coordinate with the given color using the specified render type.- Parameters:
renderType- the render type to use.x- the x-coordinate of the line.minY- the y-coordinate of the start point.maxY- the y-coordinate of the end point.color- the color of the line.
-
enableScissor
public void enableScissor(int minX, int minY, int maxX, int maxY) Enables scissoring with the specified screen coordinates.- Parameters:
minX- the minimum x-coordinate of the scissor region.minY- the minimum y-coordinate of the scissor region.maxX- the maximum x-coordinate of the scissor region.maxY- the maximum y-coordinate of the scissor region.
-
disableScissor
public void disableScissor() -
containsPointInScissor
public boolean containsPointInScissor(int x, int y) -
setColor
public void setColor(float red, float green, float blue, float alpha) Sets the current rendering color.- Parameters:
red- the red component of the color.green- the green component of the color.blue- the blue component of the color.alpha- the alpha component of the color.
-
fill
public void fill(int minX, int minY, int maxX, int maxY, int color) Fills a rectangle with the specified color using the given coordinates as the boundaries.- Parameters:
minX- the minimum x-coordinate of the rectangle.minY- the minimum y-coordinate of the rectangle.maxX- the maximum x-coordinate of the rectangle.maxY- the maximum y-coordinate of the rectangle.color- the color to fill the rectangle with.
-
fill
public void fill(int minX, int minY, int maxX, int maxY, int z, int color) Fills a rectangle with the specified color and z-level using the given coordinates as the boundaries.- Parameters:
minX- the minimum x-coordinate of the rectangle.minY- the minimum y-coordinate of the rectangle.maxX- the maximum x-coordinate of the rectangle.maxY- the maximum y-coordinate of the rectangle.z- the z-level of the rectangle.color- the color to fill the rectangle with.
-
fill
Fills a rectangle with the specified color using the given render type and coordinates as the boundaries.- Parameters:
renderType- the render type to use.minX- the minimum x-coordinate of the rectangle.minY- the minimum y-coordinate of the rectangle.maxX- the maximum x-coordinate of the rectangle.maxY- the maximum y-coordinate of the rectangle.color- the color to fill the rectangle with.
-
fill
Fills a rectangle with the specified color and z-level using the given render type and coordinates as the boundaries.- Parameters:
renderType- the render type to use.minX- the minimum x-coordinate of the rectangle.minY- the minimum y-coordinate of the rectangle.maxX- the maximum x-coordinate of the rectangle.maxY- the maximum y-coordinate of the rectangle.z- the z-level of the rectangle.color- the color to fill the rectangle with.
-
fillGradient
public void fillGradient(int x1, int y1, int x2, int y2, int colorFrom, int colorTo) Fills a rectangle with a gradient color from colorFrom to colorTo using the given coordinates as the boundaries.- Parameters:
x1- the x-coordinate of the first corner of the rectangle.y1- the y-coordinate of the first corner of the rectangle.x2- the x-coordinate of the second corner of the rectangle.y2- the y-coordinate of the second corner of the rectangle.colorFrom- the starting color of the gradient.colorTo- the ending color of the gradient.
-
fillGradient
public void fillGradient(int x1, int y1, int x2, int y2, int z, int colorFrom, int colorTo) Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given coordinates as the boundaries.- Parameters:
x1- the x-coordinate of the first corner of the rectangle.y1- the y-coordinate of the first corner of the rectangle.x2- the x-coordinate of the second corner of the rectangle.y2- the y-coordinate of the second corner of the rectangle.z- the z-level of the rectangle.colorFrom- the starting color of the gradient.colorTo- the ending color of the gradient.
-
fillGradient
public void fillGradient(RenderType renderType, int x1, int y1, int x2, int y2, int colorFrom, int colorTo, int z) Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given render type and coordinates as the boundaries.- Parameters:
renderType- the render type to use.x1- the x-coordinate of the first corner of the rectangle.y1- the y-coordinate of the first corner of the rectangle.x2- the x-coordinate of the second corner of the rectangle.y2- the y-coordinate of the second corner of the rectangle.colorFrom- the starting color of the gradient.colorTo- the ending color of the gradient.z- the z-level of the rectangle.
-
fillGradient
private void fillGradient(VertexConsumer consumer, int x1, int y1, int x2, int y2, int z, int colorFrom, int colorTo) The core `fillGradient` method.Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given render type and coordinates as the boundaries.
- Parameters:
consumer- the VertexConsumer object for drawing the vertices on screen.x1- the x-coordinate of the first corner of the rectangle.y1- the y-coordinate of the first corner of the rectangle.x2- the x-coordinate of the second corner of the rectangle.y2- the y-coordinate of the second corner of the rectangle.z- the z-level of the rectangle.colorFrom- the starting color of the gradient.colorTo- the ending color of the gradient.
-
fillRenderType
-
drawCenteredString
Draws a centered string at the specified coordinates using the given font, text, and color.- Parameters:
font- the font to use for rendering.text- the text to draw.x- the x-coordinate of the center of the string.y- the y-coordinate of the string.color- the color of the string.
-
drawCenteredString
Draws a centered string at the specified coordinates using the given font, text component, and color.- Parameters:
font- the font to use for rendering.text- the text component to draw.x- the x-coordinate of the center of the string.y- the y-coordinate of the string.color- the color of the string.
-
drawCenteredString
Draws a centered string at the specified coordinates using the given font, formatted character sequence, and color.- Parameters:
font- the font to use for rendering.text- the formatted character sequence to draw.x- the x-coordinate of the center of the string.y- the y-coordinate of the string.color- the color of the string.
-
drawString
Draws a string at the specified coordinates using the given font, text, and color. Returns the width of the drawn string.- Parameters:
font- the font to use for rendering.text- the text to draw.x- the x-coordinate of the string.y- the y-coordinate of the string.color- the color of the string.- Returns:
- the width of the drawn string.
-
drawString
public int drawString(Font font, @Nullable String text, int x, int y, int color, boolean dropShadow) Draws a string at the specified coordinates using the given font, text, color, and drop shadow. Returns the width of the drawn string.- Parameters:
font- the font to use for rendering.text- the text to draw.x- the x-coordinate of the string.y- the y-coordinate of the string.color- the color of the string.dropShadow- whether to apply a drop shadow to the string.- Returns:
- the width of the drawn string.
-
drawString
-
drawString
Draws a formatted character sequence at the specified coordinates using the given font, text, and color. Returns the width of the drawn string.- Parameters:
font- the font to use for rendering.text- the formatted character sequence to draw.x- the x-coordinate of the string.y- the y-coordinate of the string.color- the color of the string- Returns:
- the width of the drawn string.
-
drawString
public int drawString(Font font, FormattedCharSequence text, int x, int y, int color, boolean dropShadow) Draws a formatted character sequence at the specified coordinates using the given font, text, color, and drop shadow. Returns the width of the drawn string.- Parameters:
font- the font to use for rendering.text- the formatted character sequence to draw.x- the x-coordinate of the string.y- the y-coordinate of the string.color- the color of the string.dropShadow- whether to apply a drop shadow to the string.- Returns:
- returns the width of the drawn string.
-
drawString
public int drawString(Font p_282636_, FormattedCharSequence p_281596_, float p_281586_, float p_282816_, int p_281743_, boolean p_282394_) -
drawString
Draws a component's visual order text at the specified coordinates using the given font, text component, and color.- Parameters:
font- the font to use for rendering.text- the text component to draw.x- the x-coordinate of the string.y- the y-coordinate of the string.color- the color of the string.- Returns:
- the width of the drawn string.
-
drawString
Draws a component's visual order text at the specified coordinates using the given font, text component, color, and drop shadow.- Parameters:
font- the font to use for rendering.text- the text component to draw.x- the x-coordinate of the string.y- the y-coordinate of the string.color- the color of the string.dropShadow- whether to apply a drop shadow to the string.- Returns:
- the width of the drawn string.
-
drawWordWrap
Draws a formatted text with word wrapping at the specified coordinates using the given font, text, line width, and color.- Parameters:
font- the font to use for rendering.text- the formatted text to draw.x- the x-coordinate of the starting position.y- the y-coordinate of the starting position.lineWidth- the maximum width of each line before wrapping.color- the color of the text.
-
drawStringWithBackdrop
-
blit
Blits a portion of the specified texture atlas sprite onto the screen at the given coordinates.- Parameters:
x- the x-coordinate of the blit position.y- the y-coordinate of the blit position.blitOffset- the z-level offset for rendering order.width- the width of the blitted portion.height- the height of the blitted portion.sprite- the texture atlas sprite to blit.
-
blit
public void blit(int x, int y, int blitOffset, int width, int height, TextureAtlasSprite sprite, float red, float green, float blue, float alpha) Blits a portion of the specified texture atlas sprite onto the screen at the given coordinates with a color tint.- Parameters:
x- the x-coordinate of the blit position.y- the y-coordinate of the blit position.blitOffset- the z-level offset for rendering order.width- the width of the blitted portion.height- the height of the blitted portion.sprite- the texture atlas sprite to blit.red- the red component of the color tint.green- the green component of the color tint.blue- the blue component of the color tint.alpha- the alpha component of the color tint.
-
renderOutline
public void renderOutline(int x, int y, int width, int height, int color) Renders an outline rectangle on the screen with the specified color.- Parameters:
x- the x-coordinate of the top-left corner of the rectangle.y- the y-coordinate of the top-left corner of the rectangle.width- the width of the blitted portion.height- the height of the rectangle.color- the color of the outline.
-
blitSprite
-
blitSprite
public void blitSprite(ResourceLocation sprite, int x, int y, int blitOffset, int width, int height) -
blitSprite
public void blitSprite(ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight) -
blitSprite
public void blitSprite(ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int blitOffset, int uWidth, int vHeight) -
blitSprite
private void blitSprite(TextureAtlasSprite sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int blitOffset, int uWidth, int vHeight) -
blitSprite
private void blitSprite(TextureAtlasSprite sprite, int x, int y, int blitOffset, int width, int height) -
blit
public void blit(ResourceLocation atlasLocation, int x, int y, int uOffset, int vOffset, int uWidth, int vHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given coordinates.- Parameters:
atlasLocation- the location of the texture atlas.x- the x-coordinate of the blit position.y- the y-coordinate of the blit position.uOffset- the horizontal texture coordinate offset.vOffset- the vertical texture coordinate offset.uWidth- the width of the blitted portion in texture coordinates.vHeight- the height of the blitted portion in texture coordinates.
-
blit
public void blit(ResourceLocation atlasLocation, int x, int y, int blitOffset, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given coordinates with a blit offset and texture coordinates.- Parameters:
atlasLocation- the location of the texture atlas.x- the x-coordinate of the blit position.y- the y-coordinate of the blit position.blitOffset- the z-level offset for rendering order.uOffset- the horizontal texture coordinate offset.vOffset- the vertical texture coordinate offset.uWidth- the width of the blitted portion in texture coordinates.vHeight- the height of the blitted portion in texture coordinates.textureWidth- the width of the texture.textureHeight- the height of the texture.
-
blit
public void blit(ResourceLocation atlasLocation, int x, int y, int width, int height, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given position and dimensions with texture coordinates.- Parameters:
atlasLocation- the location of the texture atlas.x- the x-coordinate of the top-left corner of the blit position.y- the y-coordinate of the top-left corner of the blit position.width- the width of the blitted portion.height- the height of the blitted portion.uOffset- the horizontal texture coordinate offset.vOffset- the vertical texture coordinate offset.uWidth- the width of the blitted portion in texture coordinates.vHeight- the height of the blitted portion in texture coordinates.textureWidth- the width of the texture.textureHeight- the height of the texture.
-
blit
public void blit(ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int width, int height, int textureWidth, int textureHeight) Blits a portion of the texture specified by the atlas location onto the screen at the given position and dimensions with texture coordinates.- Parameters:
atlasLocation- the location of the texture atlas.x- the x-coordinate of the top-left corner of the blit position.y- the y-coordinate of the top-left corner of the blit position.uOffset- the horizontal texture coordinate offset.vOffset- the vertical texture coordinate offset.width- the width of the blitted portion.height- the height of the blitted portion.textureWidth- the width of the texture.textureHeight- the height of the texture.
-
blit
void blit(ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, int blitOffset, int uWidth, int vHeight, float uOffset, float vOffset, int textureWidth, int textureHeight) Performs the inner blit operation for rendering a texture with the specified coordinates and texture coordinates.- Parameters:
atlasLocation- the location of the texture atlas.x1- the x-coordinate of the first corner of the blit position.x2- the x-coordinate of the second corner of the blit position .y1- the y-coordinate of the first corner of the blit position.y2- the y-coordinate of the second corner of the blit position .blitOffset- the z-level offset for rendering order.uWidth- the width of the blitted portion in texture coordinates.vHeight- the height of the blitted portion in texture coordinates.uOffset- the horizontal texture coordinate offset.vOffset- the vertical texture coordinate offset.textureWidth- the width of the texture.textureHeight- the height of the texture.
-
innerBlit
void innerBlit(ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, int blitOffset, float minU, float maxU, float minV, float maxV) Performs the inner blit operation for rendering a texture with the specified coordinates and texture coordinates without color tinting.- Parameters:
atlasLocation- the location of the texture atlas.x1- the x-coordinate of the first corner of the blit position.x2- the x-coordinate of the second corner of the blit position .y1- the y-coordinate of the first corner of the blit position.y2- the y-coordinate of the second corner of the blit position .blitOffset- the z-level offset for rendering order.minU- the minimum horizontal texture coordinate.maxU- the maximum horizontal texture coordinate.minV- the minimum vertical texture coordinate.maxV- the maximum vertical texture coordinate.
-
innerBlit
void innerBlit(ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, int blitOffset, float minU, float maxU, float minV, float maxV, float red, float green, float blue, float alpha) Performs the inner blit operation for rendering a texture with the specified coordinates, texture coordinates, and color tint.- Parameters:
atlasLocation- the location of the texture atlas.x1- the x-coordinate of the first corner of the blit position.x2- the x-coordinate of the second corner of the blit position .y1- the y-coordinate of the first corner of the blit position.y2- the y-coordinate of the second corner of the blit position .blitOffset- the z-level offset for rendering order.minU- the minimum horizontal texture coordinate.maxU- the maximum horizontal texture coordinate.minV- the minimum vertical texture coordinate.maxV- the maximum vertical texture coordinate.red- the red component of the color tint.green- the green component of the color tint.blue- the blue component of the color tint.alpha- the alpha component of the color tint.
-
blitNineSlicedSprite
private void blitNineSlicedSprite(TextureAtlasSprite sprite, GuiSpriteScaling.NineSlice nineSlice, int x, int y, int blitOffset, int width, int height) -
blitTiledSprite
private void blitTiledSprite(TextureAtlasSprite sprite, int x, int y, int blitOffset, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight) -
renderItem
Renders an item stack at the specified coordinates.- Parameters:
stack- the item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.
-
renderItem
Renders an item stack at the specified coordinates with a random seed.- Parameters:
stack- the item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.seed- the random seed.
-
renderItem
Renders an item stack at the specified coordinates with a random seed and a custom value.- Parameters:
stack- the item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.seed- the random seed.guiOffset- the GUI offset.
-
renderFakeItem
Renders a fake item stack at the specified coordinates.- Parameters:
stack- the fake item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.
-
renderFakeItem
-
renderItem
Renders an item stack for a living entity at the specified coordinates with a random seed.- Parameters:
entity- the living entity.stack- the item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.seed- the random seed.
-
renderItem
private void renderItem(@Nullable LivingEntity entity, @Nullable Level level, ItemStack stack, int x, int y, int seed) Renders an item stack for a living entity in a specific level at the specified coordinates with a random seed.- Parameters:
entity- the living entity. Can be null.level- the level in which the rendering occurs. Can be null.stack- the item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.seed- the random seed.
-
renderItem
private void renderItem(@Nullable LivingEntity entity, @Nullable Level level, ItemStack stack, int x, int y, int seed, int guiOffset) Renders an item stack for a living entity in a specific level at the specified coordinates with a random seed and a custom GUI offset.- Parameters:
entity- the living entity. Can be null.level- the level in which the rendering occurs. Can be null.stack- the item stack to render.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.seed- the random seed.guiOffset- the GUI offset value.
-
renderItemDecorations
Renders additional decorations for an item stack at the specified coordinates.- Parameters:
font- the font used for rendering text.stack- the item stack to decorate.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.
-
renderItemDecorations
Renders additional decorations for an item stack at the specified coordinates with optional custom text.- Parameters:
font- the font used for rendering text.stack- the item stack to decorate.x- the x-coordinate of the rendering position.y- the y-coordinate of the rendering position.text- the custom text to display. Can be null.
-
renderTooltip
Renders a tooltip for an item stack at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.stack- the item stack to display the tooltip for.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-
renderTooltip
-
renderTooltip
public void renderTooltip(Font font, List<Component> tooltipLines, Optional<TooltipComponent> visualTooltipComponent, int mouseX, int mouseY) Renders a tooltip with customizable components at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.tooltipLines- the lines of the tooltip.visualTooltipComponent- the visual tooltip component. Can be empty.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-
renderTooltip
Renders a tooltip with a single line of text at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.text- the text to display in the tooltip.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-
renderComponentTooltip
Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.tooltipLines- the lines of the tooltip as components.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-
renderComponentTooltip
public void renderComponentTooltip(Font p_font, List<? extends FormattedText> tooltipLines, int p_mouseX, int p_mouseY, ItemStack stack) Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.- Parameters:
tooltipLines- the lines of the tooltip as components.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.font- the font used for rendering text.
-
renderComponentTooltipFromElements
public void renderComponentTooltipFromElements(Font font, List<com.mojang.datafixers.util.Either<FormattedText, TooltipComponent>> elements, int mouseX, int mouseY, ItemStack stack) -
renderTooltip
public void renderTooltip(Font font, List<? extends FormattedCharSequence> tooltipLines, int mouseX, int mouseY) Renders a tooltip with multiple lines of formatted text at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.tooltipLines- the lines of the tooltip as formatted character sequences.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-
renderTooltip
public void renderTooltip(Font font, List<FormattedCharSequence> tooltipLines, ClientTooltipPositioner tooltipPositioner, int mouseX, int mouseY) Renders a tooltip with multiple lines of formatted text using a custom tooltip positioner at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.tooltipLines- the lines of the tooltip as formatted character sequences.tooltipPositioner- the positioner to determine the tooltip's position.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-
renderTooltipInternal
private void renderTooltipInternal(Font font, List<ClientTooltipComponent> components, int mouseX, int mouseY, ClientTooltipPositioner tooltipPositioner) Renders an internal tooltip with customizable tooltip components at the specified mouse coordinates using a tooltip positioner.- Parameters:
font- the font used for rendering text.components- the tooltip components to render.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.tooltipPositioner- the positioner to determine the tooltip's position.
-
renderComponentHoverEffect
Renders a hover effect for a text component at the specified mouse coordinates.- Parameters:
font- the font used for rendering text.style- the style of the text component. Can be null.mouseX- the x-coordinate of the mouse position.mouseY- the y-coordinate of the mouse position.
-