Class GuiRender

java.lang.Object
codechicken.lib.gui.modular.lib.GuiRender

public class GuiRender extends Object
This class primarily based on GuiHelper from BrandonsCore But its implementation is heavily inspired by the new GuiGraphics system in 1.20+

The purpose of this class is to provide most of the basic rendering functions required to render various GUI geometry. This includes things like simple rectangles, textures, strings, etc.

Created by brandon3055 on 29/06/2023

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    This exists to allow thing like the Tooltip events to still function correctly, hopefully without exploding...
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.client.renderer.RenderType
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    GuiRender(net.minecraft.client.Minecraft mc, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource.BufferSource buffers)
     
    GuiRender(net.minecraft.client.Minecraft mc, net.minecraft.client.renderer.MultiBufferSource.BufferSource buffers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Allow similar render calls to be batched together into a single draw for better render efficiency.
    void
    borderFill(double xMin, double yMin, double xMax, double yMax, double borderWidth, int fillColour, int borderColour)
    Draw a border of specified with, fill internal area with solid colour.
    void
    borderFill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int fillColour, int borderColour)
    Draw a border of specified with, fill internal area with solid colour.
    void
    borderRect(double x, double y, double width, double height, double borderWidth, int fillColour, int borderColour)
    Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    void
    borderRect(Rectangle rectangle, double borderWidth, int fillColour, int borderColour)
    Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    void
    borderRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, double borderWidth, int fillColour, int borderColour)
    Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    void
    borderRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, double borderWidth, int fillColour, int borderColour)
    Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    net.minecraft.client.renderer.MultiBufferSource.BufferSource
     
    void
    componentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY)
     
    void
    componentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom, net.minecraft.world.item.ItemStack stack)
     
    void
    componentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY, net.minecraft.world.item.ItemStack stack)
     
    void
    componentTooltip(List<net.minecraft.network.chat.Component> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
     
    static GuiRender
    convert(net.minecraft.client.gui.GuiGraphics graphics)
     
    void
    drawCenteredString(String message, double x, double y, int colour)
    Draw centered string with shadow.
    void
    drawCenteredString(String message, double x, double y, int colour, boolean shadow)
     
    void
    drawCenteredString(net.minecraft.network.chat.Component message, double x, double y, int colour)
    Draw centered string with shadow.
    void
    drawCenteredString(net.minecraft.network.chat.Component message, double x, double y, int colour, boolean shadow)
     
    void
    drawCenteredString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour)
    Draw centered string with shadow.
    void
    drawCenteredString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour, boolean shadow)
     
    void
    drawScrollingString(net.minecraft.network.chat.Component component, double x, double y, double xMax, int colour, boolean shadow)
    If text is to long ti fit between x and xMaz, the text will scroll from left to right.
    void
    drawScrollingString(net.minecraft.network.chat.Component component, double x, double y, double xMax, int colour, boolean shadow, boolean doScissor)
    If text is to long ti fit between x and xMaz, the text will scroll from left to right.
    int
    drawString(@Nullable String message, double x, double y, int colour)
    Draw string with shadow.
    int
    drawString(@Nullable String message, double x, double y, int colour, boolean shadow)
     
    int
    drawString(net.minecraft.network.chat.Component message, double x, double y, int colour)
    Draw string with shadow.
    int
    drawString(net.minecraft.network.chat.Component message, double x, double y, int colour, boolean shadow)
     
    int
    drawString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour)
    Draw string with shadow.
    int
    drawString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour, boolean shadow)
     
    void
    drawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour)
    Draw wrapped string with shadow.
    void
    drawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour, boolean shadow)
     
    void
    drawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour, boolean shadow, double spacing)
     
    void
    dynamicTex(Material material, int x, int y, int width, int height, int topBorder, int leftBorder, int bottomBorder, int rightBorder)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    dynamicTex(Material material, int x, int y, int width, int height, int topBorder, int leftBorder, int bottomBorder, int rightBorder, float red, float green, float blue, float alpha)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    dynamicTex(Material material, int x, int y, int width, int height, int topBorder, int leftBorder, int bottomBorder, int rightBorder, int argb)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    dynamicTex(Material material, Rectangle rectangle, int topBorder, int leftBorder, int bottomBorder, int rightBorder)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    dynamicTex(Material material, Rectangle rectangle, int topBorder, int leftBorder, int bottomBorder, int rightBorder, int argb)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    dynamicTex(Material material, Rectangle rectangle, Borders borders)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    dynamicTex(Material material, Rectangle rectangle, Borders borders, int argb)
    This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want.
    void
    fill(double xMin, double yMin, double xMax, double yMax, int colour)
    Fill area with solid colour
    void
    fill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int colour)
    Fill area with solid colour
    void
     
    net.minecraft.client.gui.Font
     
    void
    gradientFillH(double xMin, double yMin, double xMax, double yMax, int leftColour, int rightColour)
    Fill area with colour gradient from left to right
    void
    gradientFillH(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int leftColour, int rightColour)
    Fill area with colour gradient from left to right
    void
    gradientFillV(double xMin, double yMin, double xMax, double yMax, int topColour, int bottomColour)
    Fill area with colour gradient from top to bottom
    void
    gradientFillV(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int topColour, int bottomColour)
    Fill area with colour gradient from top to bottom
    Deprecated.
    int
     
    int
     
    static boolean
    isInRect(double minX, double minY, double width, double height, double testX, double testY)
     
    static boolean
    isInRect(int minX, int minY, int width, int height, double testX, double testY)
     
    net.minecraft.client.Minecraft
    mc()
     
    static int
    midColour(int colour1, int colour2)
    Returns a colour half-way between the two input colours.
    static int
    mixColours(int colour1, int colour2)
    Mixes the two input colours by adding up the R, G, B and A values of each input.
    static int
    mixColours(int colour1, int colour2, boolean subtract)
    Mixes the two input colours by adding up the R, G, B and A values of each input.
    void
    overrideFont(@Nullable net.minecraft.client.gui.Font font)
    Allows you to override the font renderer used for all text rendering.
    void
    partialSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float uMin, float vMin, float uMax, float vMax, float red, float green, float blue, float alpha)
    Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    partialSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float uMin, float vMin, float uMax, float vMax, int argb)
    Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    partialSpriteTex(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, double texXMin, double texYMin, double texXMax, double texYMax, float red, float green, float blue, float alpha)
    Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    partialSpriteTex(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, double texXMin, double texYMin, double texXMax, double texYMax, int argb)
    Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
     
    com.mojang.blaze3d.vertex.PoseStack
     
    void
    pushScissor(double xMin, double yMin, double xMax, double yMax)
     
    void
    pushScissorRect(double x, double y, double width, double height)
     
    void
     
    void
    rect(double x, double y, double width, double height, int colour)
    Fill rectangle with solid colour
    void
    rect(Rectangle rectangle, int colour)
    Fill rectangle with solid colour
    void
    rect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int colour)
    Fill rectangle with solid colour
    void
    rect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int colour)
    Fill rectangle with solid colour
    void
    renderComponentHoverEffect(@Nullable net.minecraft.network.chat.Style style, int mouseX, int mouseY)
     
    void
    renderFakeItem(net.minecraft.world.item.ItemStack stack, double x, double y)
    Renders an item stack on the screen.
    void
    renderFakeItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size)
    Renders an item stack on the screen.
    void
    renderItem(@Nullable net.minecraft.world.entity.LivingEntity entity, @Nullable net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand)
    Renders an item stack on the screen.
    void
    renderItem(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand)
    Renders an item stack on the screen.
    void
    renderItem(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, double x, double y, int modelRand)
    Renders an item stack on the screen.
    void
    renderItem(net.minecraft.world.item.ItemStack stack, double x, double y)
    Renders an item stack on the screen.
    void
    renderItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size)
    Renders an item stack on the screen.
    void
    renderItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand)
    Renders an item stack on the screen.
    void
    renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y)
    Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item.
    void
    renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y, double size)
    Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item.
    void
    renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y, double size, @Nullable String text)
    Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item.
    void
    renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y, @Nullable String text)
    Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item.
    void
    renderTooltip(List<? extends net.minecraft.util.FormattedCharSequence> tooltips, double mouseX, double mouseY)
    Warning: This tooltip method with not automatically wrap tooltip lines
    void
    renderTooltip(List<? extends net.minecraft.util.FormattedCharSequence> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    Warning: This tooltip method with not automatically wrap tooltip lines
    void
    renderTooltip(List<net.minecraft.util.FormattedCharSequence> tooltips, net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner positioner, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    Warning: This tooltip method with not automatically wrap tooltip lines
    void
    renderTooltip(net.minecraft.network.chat.Component message, double mouseX, double mouseY)
     
    void
    renderTooltip(net.minecraft.network.chat.Component message, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
     
    void
    renderTooltip(net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY)
     
    void
    renderTooltip(net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
     
    void
    setColor(float red, float green, float blue, float alpha)
    Sets the render system shader colour, Effect will vary depending on what is being rendered.
    void
    shadedFill(double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour)
    Can be used to create the illusion of an inset / outset area.
    void
    shadedFill(double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
    Can be used to create the illusion of an inset / outset area.
    void
    shadedFill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
    Can be used to create the illusion of an inset / outset area.
    void
    shadedFillInternal(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
     
    void
    shadedRect(double x, double y, double width, double height, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour)
    Can be used to create the illusion of an inset / outset rectangle.
    void
    shadedRect(double x, double y, double width, double height, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
    Can be used to create the illusion of an inset / outset rectangle.
    void
    shadedRect(Rectangle rectangle, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour)
    Can be used to create the illusion of an inset / outset rectangle.
    void
    shadedRect(Rectangle rectangle, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
    Can be used to create the illusion of an inset / outset rectangle.
    void
    shadedRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
    Can be used to create the illusion of an inset / outset rectangle.
    void
    sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    void
    tex(Material material, double xMin, double yMin, double xMax, double yMax)
    Draws a texture sprite derived from the provided material.
    void
    tex(Material material, double xMin, double yMin, double xMax, double yMax, float red, float green, float blue, float alpha)
    Draws a texture sprite derived from the provided material.
    void
    tex(Material material, double xMin, double yMin, double xMax, double yMax, int argb)
    Draws a texture sprite derived from the provided material.
    void
    tex(Material material, double xMin, double yMin, double xMax, double yMax, int rotation, float red, float green, float blue, float alpha)
    Draws a texture sprite derived from the provided material.
    void
    tex(Material material, double xMin, double yMin, double xMax, double yMax, int rotation, int argb)
    Draws a texture sprite derived from the provided material.
    void
    tex(Material material, int rotation, double xMin, double yMin, double xMax, double yMax)
    Draws a texture sprite derived from the provided material.
    static net.minecraft.client.renderer.RenderType
    texColType(net.minecraft.resources.ResourceLocation location)
     
    void
    texRect(Material material, double x, double y, double width, double height)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, double x, double y, double width, double height, float red, float green, float blue, float alpha)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, double x, double y, double width, double height, int argb)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, double x, double y, double width, double height, int rotation, float red, float green, float blue, float alpha)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, int rotation, double x, double y, double width, double height)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, int rotation, double x, double y, double width, double height, int argb)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, int rotation, Rectangle rectangle)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, int rotation, Rectangle rectangle, float red, float green, float blue, float alpha)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, int rotation, Rectangle rectangle, int argb)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, Rectangle rectangle)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, Rectangle rectangle, float red, float green, float blue, float alpha)
    Draws a texture sprite derived from the provided material.
    void
    texRect(Material material, Rectangle rectangle, int argb)
    Draws a texture sprite derived from the provided material.
    static net.minecraft.client.renderer.RenderType
    texType(net.minecraft.resources.ResourceLocation location)
     
    void
    tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
    Draw a sprite tiled to fit the specified area.
    void
    tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
    Draw a sprite tiled to fit the specified area.
    void
    tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int textureWidth, int textureHeight, float red, float green, float blue, float alpha)
    Draw a sprite tiled to fit the specified area.
    void
    tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int textureWidth, int textureHeight, int argb)
    Draw a sprite tiled to fit the specified area.
    void
    toolTipBackground(double x, double y, double width, double height)
    Draws a rectangle / background with a style matching vanilla tool tips.
    void
    toolTipBackground(double x, double y, double width, double height, int backgroundColour, int borderColourTop, int borderColourBottom)
    Draws a rectangle / background with a style matching vanilla tool tips.
    void
    toolTipBackground(double x, double y, double width, double height, int backgroundColourTop, int backgroundColourBottom, int borderColourTop, int borderColourBottom, boolean empty)
    Draws a rectangle / background with a style matching vanilla tool tips.
    void
    toolTipWithImage(List<net.minecraft.network.chat.Component> tooltip, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, double mouseX, double mouseY)
     
    void
    toolTipWithImage(List<net.minecraft.network.chat.Component> tooltip, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
     
    void
    toolTipWithImage(List<net.minecraft.network.chat.Component> tooltips, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY)
     
    void
    toolTipWithImage(List<net.minecraft.network.chat.Component> tooltips, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SOLID

      public static final net.minecraft.client.renderer.RenderType SOLID
  • Constructor Details

    • GuiRender

      public GuiRender(net.minecraft.client.Minecraft mc, com.mojang.blaze3d.vertex.PoseStack poseStack, net.minecraft.client.renderer.MultiBufferSource.BufferSource buffers)
    • GuiRender

      public GuiRender(net.minecraft.client.Minecraft mc, net.minecraft.client.renderer.MultiBufferSource.BufferSource buffers)
  • Method Details

    • convert

      public static GuiRender convert(net.minecraft.client.gui.GuiGraphics graphics)
    • pose

      public com.mojang.blaze3d.vertex.PoseStack pose()
    • buffers

      public net.minecraft.client.renderer.MultiBufferSource.BufferSource buffers()
    • mc

      public net.minecraft.client.Minecraft mc()
    • font

      public net.minecraft.client.gui.Font font()
    • guiWidth

      public int guiWidth()
    • guiHeight

      public int guiHeight()
    • overrideFont

      public void overrideFont(@Nullable @Nullable net.minecraft.client.gui.Font font)
      Allows you to override the font renderer used for all text rendering. Be sure to set the override back to null when you are finished using your custom font!
      Parameters:
      font - The font to use, or null to disable override.
    • batchDraw

      public void batchDraw(Runnable batch)
      Allow similar render calls to be batched together into a single draw for better render efficiency. All render calls in batch must use the same render type.
      Parameters:
      batch - callback in which the rendering should be implemented.
    • flush

      public void flush()
    • guiGraphicsWrapper

      @Deprecated public GuiRender.RenderWrapper guiGraphicsWrapper()
      Deprecated.
      Only use this as a last resort! It may explode... Have fun!
      Returns:
      A Vanilla GuiGraphics instance that wraps this GuiRender
    • rect

      public void rect(Rectangle rectangle, int colour)
      Fill rectangle with solid colour
    • rect

      public void rect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int colour)
      Fill rectangle with solid colour
    • rect

      public void rect(double x, double y, double width, double height, int colour)
      Fill rectangle with solid colour
    • rect

      public void rect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int colour)
      Fill rectangle with solid colour
    • fill

      public void fill(double xMin, double yMin, double xMax, double yMax, int colour)
      Fill area with solid colour
    • fill

      public void fill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int colour)
      Fill area with solid colour
    • gradientFillV

      public void gradientFillV(double xMin, double yMin, double xMax, double yMax, int topColour, int bottomColour)
      Fill area with colour gradient from top to bottom
    • gradientFillV

      public void gradientFillV(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int topColour, int bottomColour)
      Fill area with colour gradient from top to bottom
    • gradientFillH

      public void gradientFillH(double xMin, double yMin, double xMax, double yMax, int leftColour, int rightColour)
      Fill area with colour gradient from left to right
    • gradientFillH

      public void gradientFillH(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int leftColour, int rightColour)
      Fill area with colour gradient from left to right
    • borderRect

      public void borderRect(Rectangle rectangle, double borderWidth, int fillColour, int borderColour)
      Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    • borderRect

      public void borderRect(double x, double y, double width, double height, double borderWidth, int fillColour, int borderColour)
      Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    • borderRect

      public void borderRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, double borderWidth, int fillColour, int borderColour)
      Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    • borderRect

      public void borderRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, double borderWidth, int fillColour, int borderColour)
      Draw a bordered rectangle of specified with specified border width, border colour and fill colour.
    • borderFill

      public void borderFill(double xMin, double yMin, double xMax, double yMax, double borderWidth, int fillColour, int borderColour)
      Draw a border of specified with, fill internal area with solid colour.
    • borderFill

      public void borderFill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int fillColour, int borderColour)
      Draw a border of specified with, fill internal area with solid colour.
    • shadedRect

      public void shadedRect(Rectangle rectangle, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour)
      Can be used to create the illusion of an inset / outset rectangle. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedRect

      public void shadedRect(double x, double y, double width, double height, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour)
      Can be used to create the illusion of an inset / outset rectangle. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedRect

      public void shadedRect(Rectangle rectangle, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
      Can be used to create the illusion of an inset / outset rectangle. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedRect

      public void shadedRect(double x, double y, double width, double height, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
      Can be used to create the illusion of an inset / outset rectangle. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedRect

      public void shadedRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
      Can be used to create the illusion of an inset / outset rectangle. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedFill

      public void shadedFill(double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour)
      Can be used to create the illusion of an inset / outset area. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedFill

      public void shadedFill(double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
      Can be used to create the illusion of an inset / outset area. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedFill

      public void shadedFill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
      Can be used to create the illusion of an inset / outset area. This is identical to the way inventory slots are rendered except in code rather than via a texture. Example Usage: render.shadedFill(0, 0, 18, 18, 1, 0xFF373737, 0xFFffffff, 0xFF8b8b8b, 0xFF8b8b8b); //Renders a vanilla style inventory slot This can also be used to render things like buttons that appear to actually "push in" when you press them.
    • shadedFillInternal

      public void shadedFillInternal(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour)
    • toolTipBackground

      public void toolTipBackground(double x, double y, double width, double height)
      Draws a rectangle / background with a style matching vanilla tool tips.
    • toolTipBackground

      public void toolTipBackground(double x, double y, double width, double height, int backgroundColour, int borderColourTop, int borderColourBottom)
      Draws a rectangle / background with a style matching vanilla tool tips. Vanilla Default Colours: 0xF0100010, 0x505000FF, 0x5028007f
    • toolTipBackground

      public void toolTipBackground(double x, double y, double width, double height, int backgroundColourTop, int backgroundColourBottom, int borderColourTop, int borderColourBottom, boolean empty)
      Draws a rectangle / background with a style matching vanilla tool tips. Vanilla Default Colours: 0xF0100010, 0xF0100010, 0x505000FF, 0x5028007f
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • sprite

      public void sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • sprite

      public void sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • sprite

      public void sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, Rectangle rectangle, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • spriteRect

      public void spriteRect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • sprite

      public void sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • sprite

      public void sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • sprite

      public void sprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int rotation, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draws a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • partialSpriteTex

      public void partialSpriteTex(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, double texXMin, double texYMin, double texXMax, double texYMax, int argb)
      Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.

      This is similar to partialSprite(RenderType, double, double, double, double, TextureAtlasSprite, float, float, float, float, int) Except the input uv values are in texture coordinates. So to draw a full 16x16 sprite with this you would supply 0, 0, 16, 16

    • partialSpriteTex

      public void partialSpriteTex(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, double texXMin, double texYMin, double texXMax, double texYMax, float red, float green, float blue, float alpha)
      Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area.

      This is similar to partialSprite(RenderType, double, double, double, double, TextureAtlasSprite, float, float, float, float, int) Except the input uv values are in texture coordinates. So to draw a full 16x16 sprite with this you would supply 0, 0, 16, 16

    • partialSprite

      public void partialSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float uMin, float vMin, float uMax, float vMax, int argb)
      Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area. Valid input u/v value range is 0 to 1 [0, 0, 1, 1 would render the full sprite]
    • partialSprite

      public void partialSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float uMin, float vMin, float uMax, float vMax, float red, float green, float blue, float alpha)
      Draws a subsection of a TextureAtlasSprite using the given render type, Vertex format should be POSITION_COLOR_TEX Texture will be resized / reshaped as appropriate to fit the defined area. Valid input u/v value range is 0 to 1 [0, 0, 1, 1 would render the full sprite]
    • tileSprite

      public void tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int argb)
      Draw a sprite tiled to fit the specified area. Sprite is drawn from the top-left so sprite will be tiled right and down.
    • tileSprite

      public void tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int textureWidth, int textureHeight, int argb)
      Draw a sprite tiled to fit the specified area. Sprite is drawn from the top-left so sprite will be tiled right and down.
      Parameters:
      textureWidth - Set base width of the sprite texture in pixels
      textureHeight - Set base height of the sprite texture in pixels
    • tileSprite

      public void tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, float red, float green, float blue, float alpha)
      Draw a sprite tiled to fit the specified area. Sprite is drawn from the top-left so sprite will be tiled right and down.
    • tileSprite

      public void tileSprite(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, int textureWidth, int textureHeight, float red, float green, float blue, float alpha)
      Draw a sprite tiled to fit the specified area. Sprite is drawn from the top-left so sprite will be tiled right and down.
      Parameters:
      textureWidth - Set base width of the sprite texture in pixels
      textureHeight - Set base height of the sprite texture in pixels
    • texRect

      public void texRect(Material material, Rectangle rectangle)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • texRect

      public void texRect(Material material, Rectangle rectangle, int argb)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • texRect

      public void texRect(Material material, Rectangle rectangle, float red, float green, float blue, float alpha)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • texRect

      public void texRect(Material material, double x, double y, double width, double height)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • texRect

      public void texRect(Material material, double x, double y, double width, double height, int argb)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • texRect

      public void texRect(Material material, double x, double y, double width, double height, float red, float green, float blue, float alpha)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • tex

      public void tex(Material material, double xMin, double yMin, double xMax, double yMax)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • tex

      public void tex(Material material, double xMin, double yMin, double xMax, double yMax, int argb)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • tex

      public void tex(Material material, double xMin, double yMin, double xMax, double yMax, float red, float green, float blue, float alpha)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
    • texRect

      public void texRect(Material material, int rotation, Rectangle rectangle)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • texRect

      public void texRect(Material material, int rotation, Rectangle rectangle, int argb)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • texRect

      public void texRect(Material material, int rotation, Rectangle rectangle, float red, float green, float blue, float alpha)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • texRect

      public void texRect(Material material, int rotation, double x, double y, double width, double height)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • texRect

      public void texRect(Material material, int rotation, double x, double y, double width, double height, int argb)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • texRect

      public void texRect(Material material, double x, double y, double width, double height, int rotation, float red, float green, float blue, float alpha)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • tex

      public void tex(Material material, int rotation, double xMin, double yMin, double xMax, double yMax)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • tex

      public void tex(Material material, double xMin, double yMin, double xMax, double yMax, int rotation, int argb)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • tex

      public void tex(Material material, double xMin, double yMin, double xMax, double yMax, int rotation, float red, float green, float blue, float alpha)
      Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area.
      Parameters:
      rotation - Rotates sprite clockwise in 90 degree steps.
    • dynamicTex

      public void dynamicTex(Material material, Rectangle rectangle, Borders borders, int argb)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • dynamicTex

      public void dynamicTex(Material material, Rectangle rectangle, int topBorder, int leftBorder, int bottomBorder, int rightBorder, int argb)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • dynamicTex

      public void dynamicTex(Material material, int x, int y, int width, int height, int topBorder, int leftBorder, int bottomBorder, int rightBorder, int argb)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • dynamicTex

      public void dynamicTex(Material material, Rectangle rectangle, Borders borders)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • dynamicTex

      public void dynamicTex(Material material, Rectangle rectangle, int topBorder, int leftBorder, int bottomBorder, int rightBorder)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • dynamicTex

      public void dynamicTex(Material material, int x, int y, int width, int height, int topBorder, int leftBorder, int bottomBorder, int rightBorder)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • dynamicTex

      public void dynamicTex(Material material, int x, int y, int width, int height, int topBorder, int leftBorder, int bottomBorder, int rightBorder, float red, float green, float blue, float alpha)
      This can be used to take something like a generic bordered background texture and dynamically resize it to draw at any size and shape you want. This is done by cutting up the texture and stitching it back to together using, cutting and tiling as required. The border parameters indicate the width of the borders around the texture, e.g. a vanilla gui texture has 4 pixel borders.
    • drawString

      public int drawString(@Nullable @Nullable String message, double x, double y, int colour)
      Draw string with shadow.
    • drawString

      public int drawString(@Nullable @Nullable String message, double x, double y, int colour, boolean shadow)
    • drawString

      public int drawString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour)
      Draw string with shadow.
    • drawString

      public int drawString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour, boolean shadow)
    • drawString

      public int drawString(net.minecraft.network.chat.Component message, double x, double y, int colour)
      Draw string with shadow.
    • drawString

      public int drawString(net.minecraft.network.chat.Component message, double x, double y, int colour, boolean shadow)
    • drawWordWrap

      public void drawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour)
      Draw wrapped string with shadow.
    • drawWordWrap

      public void drawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour, boolean shadow)
    • drawWordWrap

      public void drawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour, boolean shadow, double spacing)
    • drawCenteredString

      public void drawCenteredString(String message, double x, double y, int colour)
      Draw centered string with shadow. (centered on x position)
    • drawCenteredString

      public void drawCenteredString(String message, double x, double y, int colour, boolean shadow)
    • drawCenteredString

      public void drawCenteredString(net.minecraft.network.chat.Component message, double x, double y, int colour)
      Draw centered string with shadow. (centered on x position)
    • drawCenteredString

      public void drawCenteredString(net.minecraft.network.chat.Component message, double x, double y, int colour, boolean shadow)
    • drawCenteredString

      public void drawCenteredString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour)
      Draw centered string with shadow. (centered on x position)
    • drawCenteredString

      public void drawCenteredString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour, boolean shadow)
    • drawScrollingString

      public void drawScrollingString(net.minecraft.network.chat.Component component, double x, double y, double xMax, int colour, boolean shadow)
      If text is to long ti fit between x and xMaz, the text will scroll from left to right. Otherwise, will render centered. This is mostly copied from AbstractWidget.renderScrollingString(GuiGraphics, Font, Component, int, int, int, int, int)
    • drawScrollingString

      public void drawScrollingString(net.minecraft.network.chat.Component component, double x, double y, double xMax, int colour, boolean shadow, boolean doScissor)
      If text is to long ti fit between x and xMaz, the text will scroll from left to right. Otherwise, will render centered. This is mostly copied from AbstractWidget.renderScrollingString(GuiGraphics, Font, Component, int, int, int, int, int)
    • renderTooltip

      public void renderTooltip(net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY)
    • renderTooltip

      public void renderTooltip(net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    • toolTipWithImage

      public void toolTipWithImage(List<net.minecraft.network.chat.Component> tooltips, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY)
    • toolTipWithImage

      public void toolTipWithImage(List<net.minecraft.network.chat.Component> tooltips, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    • toolTipWithImage

      public void toolTipWithImage(List<net.minecraft.network.chat.Component> tooltip, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, double mouseX, double mouseY)
    • toolTipWithImage

      public void toolTipWithImage(List<net.minecraft.network.chat.Component> tooltip, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    • renderTooltip

      public void renderTooltip(net.minecraft.network.chat.Component message, double mouseX, double mouseY)
    • renderTooltip

      public void renderTooltip(net.minecraft.network.chat.Component message, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    • componentTooltip

      public void componentTooltip(List<net.minecraft.network.chat.Component> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
    • componentTooltip

      public void componentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY, net.minecraft.world.item.ItemStack stack)
    • componentTooltip

      public void componentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY)
    • componentTooltip

      public void componentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom, net.minecraft.world.item.ItemStack stack)
    • renderTooltip

      public void renderTooltip(List<? extends net.minecraft.util.FormattedCharSequence> tooltips, double mouseX, double mouseY)
      Warning: This tooltip method with not automatically wrap tooltip lines
    • renderTooltip

      public void renderTooltip(List<? extends net.minecraft.util.FormattedCharSequence> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
      Warning: This tooltip method with not automatically wrap tooltip lines
    • renderTooltip

      public void renderTooltip(List<net.minecraft.util.FormattedCharSequence> tooltips, net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipPositioner positioner, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom)
      Warning: This tooltip method with not automatically wrap tooltip lines
    • renderComponentHoverEffect

      public void renderComponentHoverEffect(@Nullable @Nullable net.minecraft.network.chat.Style style, int mouseX, int mouseY)
    • renderItem

      public void renderItem(net.minecraft.world.item.ItemStack stack, double x, double y)
      Renders an item stack on the screen. Important Note: Required z clearance is 32, This must be accounted for when setting the z depth in an element using this render method.
    • renderItem

      public void renderItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size)
      Renders an item stack on the screen. Important Note: Required z clearance is size*2, This must be accounted for when setting the z depth in an element using this render method.
    • renderItem

      public void renderItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand)
      Renders an item stack on the screen. Important Note: Required z clearance is size*2, This must be accounted for when setting the z depth in an element using this render method.
    • renderFakeItem

      public void renderFakeItem(net.minecraft.world.item.ItemStack stack, double x, double y)
      Renders an item stack on the screen. Important Note: Required z clearance is 32, This must be accounted for when setting the z depth in an element using this render method.
    • renderFakeItem

      public void renderFakeItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size)
      Renders an item stack on the screen. Important Note: Required z clearance is size*2, This must be accounted for when setting the z depth in an element using this render method.
    • renderItem

      public void renderItem(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, double x, double y, int modelRand)
      Renders an item stack on the screen. Important Note: Required z clearance is 32, This must be accounted for when setting the z depth in an element using this render method.
    • renderItem

      public void renderItem(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand)
      Renders an item stack on the screen. Important Note: Required z clearance is size*2, This must be accounted for when setting the z depth in an element using this render method.
    • renderItem

      public void renderItem(@Nullable @Nullable net.minecraft.world.entity.LivingEntity entity, @Nullable @Nullable net.minecraft.world.level.Level level, net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand)
      Renders an item stack on the screen. Important Note: Required z clearance is size*2, This must be accounted for when setting the z depth in an element using this render method.
      Parameters:
      size - Width and height of the stack in pixels (Standard default is 16)
      modelRand - A somewhat random value used in model gathering, Not very important, Can just use 0 or x/y position.
    • renderItemDecorations

      public void renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y)
      Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item. There is no need to fiddle with z offsets or anything, just call renderItemDecorations after renderItem and it will work. Z depth requirements are the same as the renderItem method.
    • renderItemDecorations

      public void renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y, double size)
      Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item. There is no need to fiddle with z offsets or anything, just call renderItemDecorations after renderItem and it will work. Z depth requirements are the same as the renderItem method.
    • renderItemDecorations

      public void renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y, @Nullable @Nullable String text)
      Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item. There is no need to fiddle with z offsets or anything, just call renderItemDecorations after renderItem and it will work. Z depth requirements are the same as the renderItem method.
    • renderItemDecorations

      public void renderItemDecorations(net.minecraft.world.item.ItemStack stack, double x, double y, double size, @Nullable @Nullable String text)
      Draw item decorations (Count, Damage, Cool-down) This should be rendered at the same position and size as the item. There is no need to fiddle with z offsets or anything, just call renderItemDecorations after renderItem and it will work. Z depth requirements are the same as the renderItem method.
    • pushScissorRect

      public void pushScissorRect(Rectangle rectangle)
    • pushScissorRect

      public void pushScissorRect(double x, double y, double width, double height)
    • pushScissor

      public void pushScissor(double xMin, double yMin, double xMax, double yMax)
    • popScissor

      public void popScissor()
    • setColor

      public void setColor(float red, float green, float blue, float alpha)
      Sets the render system shader colour, Effect will vary depending on what is being rendered. Ideally this should be avoided in favor of render calls that accept colour.
    • isInRect

      public static boolean isInRect(double minX, double minY, double width, double height, double testX, double testY)
    • isInRect

      public static boolean isInRect(int minX, int minY, int width, int height, double testX, double testY)
    • mixColours

      public static int mixColours(int colour1, int colour2)
      Mixes the two input colours by adding up the R, G, B and A values of each input.
    • mixColours

      public static int mixColours(int colour1, int colour2, boolean subtract)
      Mixes the two input colours by adding up the R, G, B and A values of each input.
      Parameters:
      subtract - If true, subtract colour2 from colour1, otherwise add colour2 to colour1.
    • midColour

      public static int midColour(int colour1, int colour2)
      Returns a colour half-way between the two input colours. The R, G, B and A channels are extracted from each input, Then for each chanel, a midpoint is determined, And a new colour is constructed based on the midpoint of each channel.
    • texType

      public static net.minecraft.client.renderer.RenderType texType(net.minecraft.resources.ResourceLocation location)
    • texColType

      public static net.minecraft.client.renderer.RenderType texColType(net.minecraft.resources.ResourceLocation location)