Class GuiGraphics

java.lang.Object
net.minecraft.client.gui.GuiGraphics
All Implemented Interfaces:
IGuiGraphicsExtension

public class GuiGraphics extends Object implements IGuiGraphicsExtension
  • Field Details

  • Constructor Details

  • Method Details

    • guiWidth

      public int guiWidth()
    • guiHeight

      public int guiHeight()
    • pose

      public PoseStack pose()
    • flush

      public void flush()
    • hLine

      public void hLine(int pMinX, int pMaxX, int pY, int pColor)
      Draws a horizontal line from minX to maxX at the specified y-coordinate with the given color.
      Parameters:
      pMinX - the x-coordinate of the start point.
      pMaxX - the x-coordinate of the end point.
      pY - the y-coordinate of the line.
      pColor - the color of the line.
    • hLine

      public void hLine(RenderType pRenderType, int pMinX, int pMaxX, int pY, int pColor)
      Draws a horizontal line from minX to maxX at the specified y-coordinate with the given color using the specified render type.
      Parameters:
      pRenderType - the render type to use.
      pMinX - the x-coordinate of the start point.
      pMaxX - the x-coordinate of the end point.
      pY - the y-coordinate of the line.
      pColor - the color of the line.
    • vLine

      public void vLine(int pX, int pMinY, int pMaxY, int pColor)
      Draws a vertical line from minY to maxY at the specified x-coordinate with the given color.
      Parameters:
      pX - the x-coordinate of the line.
      pMinY - the y-coordinate of the start point.
      pMaxY - the y-coordinate of the end point.
      pColor - the color of the line.
    • vLine

      public void vLine(RenderType pRenderType, int pX, int pMinY, int pMaxY, int pColor)
      Draws a vertical line from minY to maxY at the specified x-coordinate with the given color using the specified render type.
      Parameters:
      pRenderType - the render type to use.
      pX - the x-coordinate of the line.
      pMinY - the y-coordinate of the start point.
      pMaxY - the y-coordinate of the end point.
      pColor - the color of the line.
    • enableScissor

      public void enableScissor(int pMinX, int pMinY, int pMaxX, int pMaxY)
      Enables scissoring with the specified screen coordinates.
      Parameters:
      pMinX - the minimum x-coordinate of the scissor region.
      pMinY - the minimum y-coordinate of the scissor region.
      pMaxX - the maximum x-coordinate of the scissor region.
      pMaxY - the maximum y-coordinate of the scissor region.
    • disableScissor

      public void disableScissor()
    • containsPointInScissor

      public boolean containsPointInScissor(int pX, int pY)
    • applyScissor

      private void applyScissor(@Nullable ScreenRectangle pRectangle)
      Applies scissoring based on the provided screen rectangle.
      Parameters:
      pRectangle - the screen rectangle to apply scissoring with. Can be null to disable scissoring.
    • fill

      public void fill(int pMinX, int pMinY, int pMaxX, int pMaxY, int pColor)
      Fills a rectangle with the specified color using the given coordinates as the boundaries.
      Parameters:
      pMinX - the minimum x-coordinate of the rectangle.
      pMinY - the minimum y-coordinate of the rectangle.
      pMaxX - the maximum x-coordinate of the rectangle.
      pMaxY - the maximum y-coordinate of the rectangle.
      pColor - the color to fill the rectangle with.
    • fill

      public void fill(int pMinX, int pMinY, int pMaxX, int pMaxY, int pZ, int pColor)
      Fills a rectangle with the specified color and z-level using the given coordinates as the boundaries.
      Parameters:
      pMinX - the minimum x-coordinate of the rectangle.
      pMinY - the minimum y-coordinate of the rectangle.
      pMaxX - the maximum x-coordinate of the rectangle.
      pMaxY - the maximum y-coordinate of the rectangle.
      pZ - the z-level of the rectangle.
      pColor - the color to fill the rectangle with.
    • fill

      public void fill(RenderType pRenderType, int pMinX, int pMinY, int pMaxX, int pMaxY, int pColor)
      Fills a rectangle with the specified color using the given render type and coordinates as the boundaries.
      Parameters:
      pRenderType - the render type to use.
      pMinX - the minimum x-coordinate of the rectangle.
      pMinY - the minimum y-coordinate of the rectangle.
      pMaxX - the maximum x-coordinate of the rectangle.
      pMaxY - the maximum y-coordinate of the rectangle.
      pColor - the color to fill the rectangle with.
    • fill

      public void fill(RenderType pRenderType, int pMinX, int pMinY, int pMaxX, int pMaxY, int pZ, int pColor)
      Fills a rectangle with the specified color and z-level using the given render type and coordinates as the boundaries.
      Parameters:
      pRenderType - the render type to use.
      pMinX - the minimum x-coordinate of the rectangle.
      pMinY - the minimum y-coordinate of the rectangle.
      pMaxX - the maximum x-coordinate of the rectangle.
      pMaxY - the maximum y-coordinate of the rectangle.
      pZ - the z-level of the rectangle.
      pColor - the color to fill the rectangle with.
    • fillGradient

      public void fillGradient(int pX1, int pY1, int pX2, int pY2, int pColorFrom, int pColorTo)
      Fills a rectangle with a gradient color from colorFrom to colorTo using the given coordinates as the boundaries.
      Parameters:
      pX1 - the x-coordinate of the first corner of the rectangle.
      pY1 - the y-coordinate of the first corner of the rectangle.
      pX2 - the x-coordinate of the second corner of the rectangle.
      pY2 - the y-coordinate of the second corner of the rectangle.
      pColorFrom - the starting color of the gradient.
      pColorTo - the ending color of the gradient.
    • fillGradient

      public void fillGradient(int pX1, int pY1, int pX2, int pY2, int pZ, int pColorFrom, int pColorTo)
      Fills a rectangle with a gradient color from colorFrom to colorTo at the specified z-level using the given coordinates as the boundaries.
      Parameters:
      pX1 - the x-coordinate of the first corner of the rectangle.
      pY1 - the y-coordinate of the first corner of the rectangle.
      pX2 - the x-coordinate of the second corner of the rectangle.
      pY2 - the y-coordinate of the second corner of the rectangle.
      pZ - the z-level of the rectangle.
      pColorFrom - the starting color of the gradient.
      pColorTo - the ending color of the gradient.
    • fillGradient

      public void fillGradient(RenderType pRenderType, int pX1, int pY1, int pX2, int pY2, int pColorFrom, int pColorTo, int pZ)
      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:
      pRenderType - the render type to use.
      pX1 - the x-coordinate of the first corner of the rectangle.
      pY1 - the y-coordinate of the first corner of the rectangle.
      pX2 - the x-coordinate of the second corner of the rectangle.
      pY2 - the y-coordinate of the second corner of the rectangle.
      pColorFrom - the starting color of the gradient.
      pColorTo - the ending color of the gradient.
      pZ - the z-level of the rectangle.
    • fillGradient

      private void fillGradient(VertexConsumer pConsumer, int pX1, int pY1, int pX2, int pY2, int pZ, int pColorFrom, int pColorTo)
      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:
      pConsumer - the VertexConsumer object for drawing the vertices on screen.
      pX1 - the x-coordinate of the first corner of the rectangle.
      pY1 - the y-coordinate of the first corner of the rectangle.
      pX2 - the x-coordinate of the second corner of the rectangle.
      pY2 - the y-coordinate of the second corner of the rectangle.
      pZ - the z-level of the rectangle.
      pColorFrom - the starting color of the gradient.
      pColorTo - the ending color of the gradient.
    • fillRenderType

      public void fillRenderType(RenderType pRenderType, int pX1, int pY1, int pX2, int pY2, int pZ)
    • drawCenteredString

      public void drawCenteredString(Font pFont, String pText, int pX, int pY, int pColor)
      Draws a centered string at the specified coordinates using the given font, text, and color.
      Parameters:
      pFont - the font to use for rendering.
      pText - the text to draw.
      pX - the x-coordinate of the center of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
    • drawCenteredString

      public void drawCenteredString(Font pFont, Component pText, int pX, int pY, int pColor)
      Draws a centered string at the specified coordinates using the given font, text component, and color.
      Parameters:
      pFont - the font to use for rendering.
      pText - the text component to draw.
      pX - the x-coordinate of the center of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
    • drawCenteredString

      public void drawCenteredString(Font pFont, FormattedCharSequence pText, int pX, int pY, int pColor)
      Draws a centered string at the specified coordinates using the given font, formatted character sequence, and color.
      Parameters:
      pFont - the font to use for rendering.
      pText - the formatted character sequence to draw.
      pX - the x-coordinate of the center of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
    • drawString

      public int drawString(Font pFont, @Nullable String pText, int pX, int pY, int pColor)
      Draws a string at the specified coordinates using the given font, text, and color. Returns the width of the drawn string.

      Parameters:
      pFont - the font to use for rendering.
      pText - the text to draw.
      pX - the x-coordinate of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
      Returns:
      the width of the drawn string.
    • drawString

      public int drawString(Font pFont, @Nullable String pText, int pX, int pY, int pColor, boolean pDropShadow)
      Draws a string at the specified coordinates using the given font, text, color, and drop shadow. Returns the width of the drawn string.

      Parameters:
      pFont - the font to use for rendering.
      pText - the text to draw.
      pX - the x-coordinate of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
      pDropShadow - whether to apply a drop shadow to the string.
      Returns:
      the width of the drawn string.
    • drawString

      public int drawString(Font p_283343_, @Nullable String p_281896_, float p_283569_, float p_283418_, int p_281560_, boolean p_282130_)
    • drawString

      public int drawString(Font pFont, FormattedCharSequence pText, int pX, int pY, int pColor)
      Draws a formatted character sequence at the specified coordinates using the given font, text, and color. Returns the width of the drawn string.

      Parameters:
      pFont - the font to use for rendering.
      pText - the formatted character sequence to draw.
      pX - the x-coordinate of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string
      Returns:
      the width of the drawn string.
    • drawString

      public int drawString(Font pFont, FormattedCharSequence pText, int pX, int pY, int pColor, boolean pDropShadow)
      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:
      pFont - the font to use for rendering.
      pText - the formatted character sequence to draw.
      pX - the x-coordinate of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
      pDropShadow - 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

      public int drawString(Font pFont, Component pText, int pX, int pY, int pColor)
      Draws a component's visual order text at the specified coordinates using the given font, text component, and color.

      Parameters:
      pFont - the font to use for rendering.
      pText - the text component to draw.
      pX - the x-coordinate of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
      Returns:
      the width of the drawn string.
    • drawString

      public int drawString(Font pFont, Component pText, int pX, int pY, int pColor, boolean pDropShadow)
      Draws a component's visual order text at the specified coordinates using the given font, text component, color, and drop shadow.

      Parameters:
      pFont - the font to use for rendering.
      pText - the text component to draw.
      pX - the x-coordinate of the string.
      pY - the y-coordinate of the string.
      pColor - the color of the string.
      pDropShadow - whether to apply a drop shadow to the string.
      Returns:
      the width of the drawn string.
    • drawWordWrap

      public void drawWordWrap(Font pFont, FormattedText pText, int pX, int pY, int pLineWidth, int pColor)
      Draws a formatted text with word wrapping at the specified coordinates using the given font, text, line width, and color.
      Parameters:
      pFont - the font to use for rendering.
      pText - the formatted text to draw.
      pX - the x-coordinate of the starting position.
      pY - the y-coordinate of the starting position.
      pLineWidth - the maximum width of each line before wrapping.
      pColor - the color of the text.
    • drawWordWrap

      public void drawWordWrap(Font pFont, FormattedText pText, int pX, int pY, int pLineWidth, int pColor, boolean pDropShadow)
    • drawStringWithBackdrop

      public int drawStringWithBackdrop(Font pFont, Component pText, int pX, int pY, int pXOffset, int pColor)
    • renderOutline

      public void renderOutline(int pX, int pY, int pWidth, int pHeight, int pColor)
      Renders an outline rectangle on the screen with the specified color.
      Parameters:
      pX - the x-coordinate of the top-left corner of the rectangle.
      pY - the y-coordinate of the top-left corner of the rectangle.
      pWidth - the width of the blitted portion.
      pHeight - the height of the rectangle.
      pColor - the color of the outline.
    • blitSprite

      public void blitSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pSprite, int pX, int pY, int pWidth, int pHeight)
    • blitSprite

      public void blitSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pSprite, int pX, int pY, int pWidth, int pHeight, int pBlitOffset)
    • blitSprite

      public void blitSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pSprite, int pTextureWidth, int pTextureHeight, int pUPosition, int pVPosition, int pX, int pY, int pUWidth, int pVHeight)
    • blitSprite

      public void blitSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, TextureAtlasSprite pSprite, int pX, int pY, int pWidth, int pHeight)
    • blitSprite

      public void blitSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, TextureAtlasSprite pSprite, int pX, int pY, int pWidth, int pHeight, int pBlitOffset)
    • blitSprite

      private void blitSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, TextureAtlasSprite pSprite, int pTextureWidth, int pTextureHeight, int pUPosition, int pVPosition, int pX, int pY, int pUWidth, int pVHeight, int pBlitOffset)
    • blitNineSlicedSprite

      private void blitNineSlicedSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, TextureAtlasSprite pSprite, GuiSpriteScaling.NineSlice pNineSlice, int pX, int pY, int pBlitOffset, int pWidth, int pHeight)
    • blitNineSliceInnerSegment

      private void blitNineSliceInnerSegment(Function<ResourceLocation,RenderType> pRenderTypeGetter, GuiSpriteScaling.NineSlice pNineSlice, TextureAtlasSprite pSprite, int pX, int pY, int pWidth, int pHeight, int pUPosition, int pVPosition, int pSpriteWidth, int pSpriteHeight, int pNineSliceWidth, int pNineSliceHeight, int pBlitOffset)
    • blitTiledSprite

      private void blitTiledSprite(Function<ResourceLocation,RenderType> pRenderTypeGetter, TextureAtlasSprite pSprite, int pX, int pY, int pWidth, int pHeight, int pUPosition, int pVPosition, int pSpriteWidth, int pSpriteHeight, int pNineSliceWidth, int pNineSliceHeight, int pBlitOffset)
    • blit

      public void blit(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pAtlasLocation, int pX, int pY, float pUOffset, float pVOffset, int pUWidth, int pVHeight, int pTextureWidth, int pTextureHeight, int pColor)
    • blit

      public void blit(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pAtlasLocation, int pX, int pY, float pUOffset, float pVOffset, int pUWidth, int pVHeight, int pTextureWidth, int pTextureHeight)
    • blit

      public void blit(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pAtlasLocation, int pX, int pY, float pUOffset, float pVOffset, int pUWidth, int pVHeight, int pWidth, int pHeight, int pTextureWidth, int pTextureHeight)
    • blit

      public void blit(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pAtlasLocation, int pX, int pY, float pUOffset, float pVOffset, int pUWidth, int pVHeight, int pWidth, int pHeight, int pTextureWidth, int pTextureHeight, int pColor)
    • innerBlit

      private void innerBlit(Function<ResourceLocation,RenderType> pRenderTypeGetter, ResourceLocation pAtlasLocation, int pX1, int pX2, int pY1, int pY2, float pMinU, float pMaxU, float pMinV, float pMaxV, int pColor)
    • renderItem

      public void renderItem(ItemStack pStack, int pX, int pY)
      Renders an item stack at the specified coordinates.
      Parameters:
      pStack - the item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
    • renderItem

      public void renderItem(ItemStack pStack, int pX, int pY, int pSeed)
      Renders an item stack at the specified coordinates with a random seed.
      Parameters:
      pStack - the item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
      pSeed - the random seed.
    • renderItem

      public void renderItem(ItemStack pStack, int pX, int pY, int pSeed, int pGuiOffset)
      Renders an item stack at the specified coordinates with a random seed and a custom value.
      Parameters:
      pStack - the item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
      pSeed - the random seed.
      pGuiOffset - the GUI offset.
    • renderFakeItem

      public void renderFakeItem(ItemStack pStack, int pX, int pY)
      Renders a fake item stack at the specified coordinates.
      Parameters:
      pStack - the fake item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
    • renderFakeItem

      public void renderFakeItem(ItemStack pStack, int pX, int pY, int pSeed)
    • renderItem

      public void renderItem(LivingEntity pEntity, ItemStack pStack, int pX, int pY, int pSeed)
      Renders an item stack for a living entity at the specified coordinates with a random seed.
      Parameters:
      pEntity - the living entity.
      pStack - the item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
      pSeed - the random seed.
    • renderItem

      private void renderItem(@Nullable LivingEntity pEntity, @Nullable Level pLevel, ItemStack pStack, int pX, int pY, int pSeed)
      Renders an item stack for a living entity in a specific level at the specified coordinates with a random seed.
      Parameters:
      pEntity - the living entity. Can be null.
      pLevel - the level in which the rendering occurs. Can be null.
      pStack - the item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
      pSeed - the random seed.
    • renderItem

      private void renderItem(@Nullable LivingEntity pEntity, @Nullable Level pLevel, ItemStack pStack, int pX, int pY, int pSeed, int pGuiOffset)
      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:
      pEntity - the living entity. Can be null.
      pLevel - the level in which the rendering occurs. Can be null.
      pStack - the item stack to render.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
      pSeed - the random seed.
      pGuiOffset - the GUI offset value.
    • renderItemDecorations

      public void renderItemDecorations(Font pFont, ItemStack pStack, int pX, int pY)
      Renders additional decorations for an item stack at the specified coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pStack - the item stack to decorate.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
    • renderItemDecorations

      public void renderItemDecorations(Font pFont, ItemStack pStack, int pX, int pY, @Nullable String pText)
      Renders additional decorations for an item stack at the specified coordinates with optional custom text.
      Parameters:
      pFont - the font used for rendering text.
      pStack - the item stack to decorate.
      pX - the x-coordinate of the rendering position.
      pY - the y-coordinate of the rendering position.
      pText - the custom text to display. Can be null.
    • renderTooltip

      public void renderTooltip(Font pFont, ItemStack pStack, int pMouseX, int pMouseY)
      Renders a tooltip for an item stack at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pStack - the item stack to display the tooltip for.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderTooltip

      public void renderTooltip(Font font, List<Component> textComponents, Optional<TooltipComponent> tooltipComponent, ItemStack stack, int mouseX, int mouseY)
    • 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 pFont, List<Component> pTooltipLines, Optional<TooltipComponent> pVisualTooltipComponent, int pMouseX, int pMouseY)
      Renders a tooltip with customizable components at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pTooltipLines - the lines of the tooltip.
      pVisualTooltipComponent - the visual tooltip component. Can be empty.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderTooltip

      public void renderTooltip(Font pFont, List<Component> pTooltipLines, Optional<TooltipComponent> pVisualTooltipComponent, int pMouseX, int pMouseY, @Nullable ResourceLocation pSprite)
    • renderTooltip

      public void renderTooltip(Font pFont, Component pText, int pMouseX, int pMouseY)
      Renders a tooltip with a single line of text at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pText - the text to display in the tooltip.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderTooltip

      public void renderTooltip(Font pFont, Component pText, int pMouseX, int pMouseY, @Nullable ResourceLocation pSprite)
    • renderComponentTooltip

      public void renderComponentTooltip(Font pFont, List<Component> pTooltipLines, int pMouseX, int pMouseY)
      Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pTooltipLines - the lines of the tooltip as components.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderComponentTooltip

      public void renderComponentTooltip(Font pFont, List<Component> pTooltipLines, int pMouseX, int pMouseY, @Nullable ResourceLocation pSprite)
    • renderComponentTooltip

      public void renderComponentTooltip(Font pFont, List<? extends FormattedText> pTooltipLines, int pMouseX, int pMouseY, ItemStack stack)
      Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pTooltipLines - the lines of the tooltip as components.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderComponentTooltip

      public void renderComponentTooltip(Font pFont, List<? extends FormattedText> pTooltipLines, int pMouseX, int pMouseY, ItemStack stack, @Nullable ResourceLocation backgroundTexture)
      Renders a tooltip with multiple lines of component-based text at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pTooltipLines - the lines of the tooltip as components.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - 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 pFont, List<? extends FormattedCharSequence> pTooltipLines, int pMouseX, int pMouseY)
      Renders a tooltip with multiple lines of formatted text at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pTooltipLines - the lines of the tooltip as formatted character sequences.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderTooltip

      public void renderTooltip(Font pFont, List<? extends FormattedCharSequence> pTooltipLines, int pMouseX, int pMouseY, @Nullable ResourceLocation pSprite)
    • renderTooltip

      public void renderTooltip(Font pFont, List<FormattedCharSequence> pTooltipLines, ClientTooltipPositioner pTooltipPositioner, int pMouseX, int pMouseY)
      Renders a tooltip with multiple lines of formatted text using a custom tooltip positioner at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pTooltipLines - the lines of the tooltip as formatted character sequences.
      pTooltipPositioner - the positioner to determine the tooltip's position.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • renderTooltipInternal

      private void renderTooltipInternal(Font pFont, List<ClientTooltipComponent> pTooltipLines, int pMouseX, int pMouseY, ClientTooltipPositioner pTooltipPositioner, @Nullable ResourceLocation pSprite)
    • renderItemBar

      private void renderItemBar(ItemStack pStack, int pX, int pY)
    • renderItemCount

      private void renderItemCount(Font pFont, ItemStack pStack, int pX, int pY, @Nullable String pText)
    • renderItemCooldown

      private void renderItemCooldown(ItemStack pStack, int pX, int pY)
    • renderComponentHoverEffect

      public void renderComponentHoverEffect(Font pFont, @Nullable Style pStyle, int pMouseX, int pMouseY)
      Renders a hover effect for a text component at the specified mouse coordinates.
      Parameters:
      pFont - the font used for rendering text.
      pStyle - the style of the text component. Can be null.
      pMouseX - the x-coordinate of the mouse position.
      pMouseY - the y-coordinate of the mouse position.
    • drawSpecial

      public void drawSpecial(Consumer<MultiBufferSource> pDrawer)