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 intstatic final floatstatic final floatprivate final Minecraftprivate final PoseStackprivate final GuiGraphics.ScissorStackprivate final ItemStackRenderStateprivate 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(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) voidblit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight, int color) voidblit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int width, int height, int textureWidth, int textureHeight) voidblit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int width, int height, int textureWidth, int textureHeight, int color) private voidblitNineSlicedSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, GuiSpriteScaling.NineSlice nineSlice, int x, int y, int blitOffset, int width, int height) private voidblitNineSliceInnerSegment(Function<ResourceLocation, RenderType> renderTypeGetter, GuiSpriteScaling.NineSlice nineSlice, TextureAtlasSprite sprite, int x, int y, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight, int blitOffset) voidblitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height) voidblitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height, int blitOffset) private voidblitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight, int blitOffset) voidblitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation sprite, int x, int y, int width, int height) voidblitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation sprite, int x, int y, int width, int height, int blitOffset) voidblitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight) private voidblitTiledSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight, int blitOffset) 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.voiddrawSpecial(Consumer<MultiBufferSource> drawer) 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.voiddrawWordWrap(Font font, FormattedText text, int x, int y, int lineWidth, int color, boolean dropShadow) 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()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.private voidinnerBlit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, float minU, float maxU, float minV, float maxV, int color) 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 font, List<? extends FormattedText> tooltipLines, int mouseX, int mouseY, ItemStack stack) Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.voidrenderComponentTooltip(Font font, List<? extends FormattedText> tooltipLines, int mouseX, int mouseY, ItemStack stack, ResourceLocation backgroundTexture) 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.voidrenderComponentTooltip(Font font, List<Component> tooltipLines, int mouseX, int mouseY, ResourceLocation sprite) voidrenderComponentTooltipFromElements(Font font, List<com.mojang.datafixers.util.Either<FormattedText, TooltipComponent>> elements, int mouseX, int mouseY, ItemStack stack) voidrenderComponentTooltipFromElements(Font font, List<com.mojang.datafixers.util.Either<FormattedText, TooltipComponent>> elements, int mouseX, int mouseY, ItemStack stack, ResourceLocation backgroundTexture) 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.private voidrenderItemBar(ItemStack stack, int x, int y) private voidrenderItemCooldown(ItemStack stack, int x, int y) private voidrenderItemCount(Font font, ItemStack stack, int x, int y, String text) 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<? extends FormattedCharSequence> tooltipLines, int mouseX, int mouseY, ResourceLocation sprite) 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> tooltipLines, Optional<TooltipComponent> visualTooltipComponent, int mouseX, int mouseY, ResourceLocation sprite) voidrenderTooltip(Font font, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, ItemStack stack, int mouseX, int mouseY) voidrenderTooltip(Font font, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, ItemStack stack, int mouseX, int mouseY, ResourceLocation backgroundTexture) 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, Component text, int mouseX, int mouseY, ResourceLocation sprite) 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> tooltipLines, int mouseX, int mouseY, ClientTooltipPositioner tooltipPositioner, ResourceLocation sprite) 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, 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
-
scratchItemStackRenderState
-
tooltipStack
-
-
Constructor Details
-
GuiGraphics
private GuiGraphics(Minecraft minecraft, PoseStack pose, MultiBufferSource.BufferSource bufferSource) -
GuiGraphics
-
-
Method Details
-
guiWidth
public int guiWidth() -
guiHeight
public int guiHeight() -
pose
-
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) -
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.
-
drawWordWrap
public void drawWordWrap(Font font, FormattedText text, int x, int y, int lineWidth, int color, boolean dropShadow) -
drawStringWithBackdrop
-
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
public void blitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation sprite, int x, int y, int width, int height) -
blitSprite
public void blitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation sprite, int x, int y, int width, int height, int blitOffset) -
blitSprite
public void blitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight) -
blitSprite
public void blitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height) -
blitSprite
public void blitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height, int blitOffset) -
blitSprite
private void blitSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int textureWidth, int textureHeight, int uPosition, int vPosition, int x, int y, int uWidth, int vHeight, int blitOffset) -
blitNineSlicedSprite
private void blitNineSlicedSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, GuiSpriteScaling.NineSlice nineSlice, int x, int y, int blitOffset, int width, int height) -
blitNineSliceInnerSegment
private void blitNineSliceInnerSegment(Function<ResourceLocation, RenderType> renderTypeGetter, GuiSpriteScaling.NineSlice nineSlice, TextureAtlasSprite sprite, int x, int y, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight, int blitOffset) -
blitTiledSprite
private void blitTiledSprite(Function<ResourceLocation, RenderType> renderTypeGetter, TextureAtlasSprite sprite, int x, int y, int width, int height, int uPosition, int vPosition, int spriteWidth, int spriteHeight, int nineSliceWidth, int nineSliceHeight, int blitOffset) -
blit
public void blit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight, int color) -
blit
public void blit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int textureWidth, int textureHeight) -
blit
public void blit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int width, int height, int textureWidth, int textureHeight) -
blit
public void blit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x, int y, float uOffset, float vOffset, int uWidth, int vHeight, int width, int height, int textureWidth, int textureHeight, int color) -
innerBlit
private void innerBlit(Function<ResourceLocation, RenderType> renderTypeGetter, ResourceLocation atlasLocation, int x1, int x2, int y1, int y2, float minU, float maxU, float minV, float maxV, int color) -
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> textComponents, Optional<TooltipComponent> tooltipComponent, ItemStack stack, int mouseX, int mouseY, @Nullable ResourceLocation backgroundTexture) -
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
public void renderTooltip(Font font, List<Component> tooltipLines, Optional<TooltipComponent> visualTooltipComponent, int mouseX, int mouseY, @Nullable ResourceLocation sprite) -
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.
-
renderTooltip
public void renderTooltip(Font font, Component text, int mouseX, int mouseY, @Nullable ResourceLocation sprite) -
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 font, List<Component> tooltipLines, int mouseX, int mouseY, @Nullable ResourceLocation sprite) -
renderComponentTooltip
public void renderComponentTooltip(Font font, List<? extends FormattedText> tooltipLines, int mouseX, int mouseY, ItemStack stack) 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 font, List<? extends FormattedText> tooltipLines, int mouseX, int mouseY, ItemStack stack, @Nullable ResourceLocation backgroundTexture) 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.
-
renderComponentTooltipFromElements
public void renderComponentTooltipFromElements(Font font, List<com.mojang.datafixers.util.Either<FormattedText, TooltipComponent>> elements, int mouseX, int mouseY, ItemStack stack) -
renderComponentTooltipFromElements
public void renderComponentTooltipFromElements(Font font, List<com.mojang.datafixers.util.Either<FormattedText, TooltipComponent>> elements, int mouseX, int mouseY, ItemStack stack, @Nullable ResourceLocation backgroundTexture) -
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<? extends FormattedCharSequence> tooltipLines, int mouseX, int mouseY, @Nullable ResourceLocation sprite) -
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> tooltipLines, int mouseX, int mouseY, ClientTooltipPositioner tooltipPositioner, @Nullable ResourceLocation sprite) -
renderItemBar
-
renderItemCount
-
renderItemCooldown
-
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.
-
drawSpecial
-