Package codechicken.lib.gui.modular.lib
Class GuiRender
java.lang.Object
codechicken.lib.gui.modular.lib.GuiRender
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 ClassesModifier and TypeClassDescriptionstatic classThis exists to allow thing like the Tooltip events to still function correctly, hopefully without exploding... -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGuiRender(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 TypeMethodDescriptionvoidAllow similar render calls to be batched together into a single draw for better render efficiency.voidborderFill(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.voidborderFill(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.voidborderRect(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.voidborderRect(Rectangle rectangle, double borderWidth, int fillColour, int borderColour) Draw a bordered rectangle of specified with specified border width, border colour and fill colour.voidborderRect(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.voidborderRect(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.BufferSourcebuffers()voidcomponentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY) voidcomponentTooltip(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) voidcomponentTooltip(List<? extends net.minecraft.network.chat.FormattedText> tooltips, double mouseX, double mouseY, net.minecraft.world.item.ItemStack stack) voidcomponentTooltip(List<net.minecraft.network.chat.Component> tooltips, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom) static GuiRenderconvert(net.minecraft.client.gui.GuiGraphics graphics) voiddrawCenteredString(String message, double x, double y, int colour) Draw centered string with shadow.voiddrawCenteredString(String message, double x, double y, int colour, boolean shadow) voiddrawCenteredString(net.minecraft.network.chat.Component message, double x, double y, int colour) Draw centered string with shadow.voiddrawCenteredString(net.minecraft.network.chat.Component message, double x, double y, int colour, boolean shadow) voiddrawCenteredString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour) Draw centered string with shadow.voiddrawCenteredString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour, boolean shadow) voiddrawScrollingString(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.voiddrawScrollingString(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.intdrawString(@Nullable String message, double x, double y, int colour) Draw string with shadow.intdrawString(@Nullable String message, double x, double y, int colour, boolean shadow) intdrawString(net.minecraft.network.chat.Component message, double x, double y, int colour) Draw string with shadow.intdrawString(net.minecraft.network.chat.Component message, double x, double y, int colour, boolean shadow) intdrawString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour) Draw string with shadow.intdrawString(net.minecraft.util.FormattedCharSequence message, double x, double y, int colour, boolean shadow) voiddrawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour) Draw wrapped string with shadow.voiddrawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour, boolean shadow) voiddrawWordWrap(net.minecraft.network.chat.FormattedText message, double x, double y, int width, int colour, boolean shadow, double spacing) voiddynamicTex(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.voiddynamicTex(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.voiddynamicTex(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.voiddynamicTex(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.voiddynamicTex(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.voiddynamicTex(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.voiddynamicTex(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.voidfill(double xMin, double yMin, double xMax, double yMax, int colour) Fill area with solid colourvoidfill(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, int colour) Fill area with solid colourvoidflush()net.minecraft.client.gui.Fontfont()voidgradientFillH(double xMin, double yMin, double xMax, double yMax, int leftColour, int rightColour) Fill area with colour gradient from left to rightvoidgradientFillH(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 rightvoidgradientFillV(double xMin, double yMin, double xMax, double yMax, int topColour, int bottomColour) Fill area with colour gradient from top to bottomvoidgradientFillV(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 bottomDeprecated.intintguiWidth()static booleanisInRect(double minX, double minY, double width, double height, double testX, double testY) static booleanisInRect(int minX, int minY, int width, int height, double testX, double testY) net.minecraft.client.Minecraftmc()static intmidColour(int colour1, int colour2) Returns a colour half-way between the two input colours.static intmixColours(int colour1, int colour2) Mixes the two input colours by adding up the R, G, B and A values of each input.static intmixColours(int colour1, int colour2, boolean subtract) Mixes the two input colours by adding up the R, G, B and A values of each input.voidoverrideFont(@Nullable net.minecraft.client.gui.Font font) Allows you to override the font renderer used for all text rendering.voidpartialSprite(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.voidpartialSprite(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.voidpartialSpriteTex(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.voidpartialSpriteTex(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.voidcom.mojang.blaze3d.vertex.PoseStackpose()voidpushScissor(double xMin, double yMin, double xMax, double yMax) voidpushScissorRect(double x, double y, double width, double height) voidpushScissorRect(Rectangle rectangle) voidrect(double x, double y, double width, double height, int colour) Fill rectangle with solid colourvoidFill rectangle with solid colourvoidrect(net.minecraft.client.renderer.RenderType type, double x, double y, double width, double height, int colour) Fill rectangle with solid colourvoidFill rectangle with solid colourvoidrenderComponentHoverEffect(@Nullable net.minecraft.network.chat.Style style, int mouseX, int mouseY) voidrenderFakeItem(net.minecraft.world.item.ItemStack stack, double x, double y) Renders an item stack on the screen.voidrenderFakeItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size) Renders an item stack on the screen.voidrenderItem(@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.voidrenderItem(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.voidrenderItem(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.voidrenderItem(net.minecraft.world.item.ItemStack stack, double x, double y) Renders an item stack on the screen.voidrenderItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size) Renders an item stack on the screen.voidrenderItem(net.minecraft.world.item.ItemStack stack, double x, double y, double size, int modelRand) Renders an item stack on the screen.voidrenderItemDecorations(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.voidrenderItemDecorations(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.voidrenderItemDecorations(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.voidrenderItemDecorations(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.voidrenderTooltip(List<? extends net.minecraft.util.FormattedCharSequence> tooltips, double mouseX, double mouseY) Warning: This tooltip method with not automatically wrap tooltip linesvoidrenderTooltip(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 linesvoidrenderTooltip(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 linesvoidrenderTooltip(net.minecraft.network.chat.Component message, double mouseX, double mouseY) voidrenderTooltip(net.minecraft.network.chat.Component message, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom) voidrenderTooltip(net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY) voidrenderTooltip(net.minecraft.world.item.ItemStack stack, double mouseX, double mouseY, int backgroundTop, int backgroundBottom, int borderTop, int borderBottom) voidsetColor(float red, float green, float blue, float alpha) Sets the render system shader colour, Effect will vary depending on what is being rendered.voidshadedFill(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.voidshadedFill(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.voidshadedFill(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.voidshadedFillInternal(net.minecraft.client.renderer.RenderType type, double xMin, double yMin, double xMax, double yMax, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour) voidshadedRect(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.voidshadedRect(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.voidshadedRect(Rectangle rectangle, double borderWidth, int topLeftColour, int bottomRightColour, int fillColour) Can be used to create the illusion of an inset / outset rectangle.voidshadedRect(Rectangle rectangle, double borderWidth, int topLeftColour, int bottomRightColour, int cornerMixColour, int fillColour) Can be used to create the illusion of an inset / outset rectangle.voidshadedRect(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.voidsprite(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.voidsprite(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.voidsprite(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.voidsprite(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.voidsprite(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.voidsprite(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidspriteRect(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.voidDraws a texture sprite derived from the provided material.voidtex(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.voidDraws a texture sprite derived from the provided material.voidtex(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.voidDraws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.static net.minecraft.client.renderer.RenderTypetexColType(net.minecraft.resources.ResourceLocation location) voidDraws a texture sprite derived from the provided material.voidtexRect(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.voidDraws a texture sprite derived from the provided material.voidtexRect(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.voidDraws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.voidtexRect(Material material, int rotation, Rectangle rectangle, float red, float green, float blue, float alpha) Draws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.voidDraws a texture sprite derived from the provided material.static net.minecraft.client.renderer.RenderTypetexType(net.minecraft.resources.ResourceLocation location) voidtileSprite(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.voidtileSprite(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.voidtileSprite(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.voidtileSprite(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.voidtoolTipBackground(double x, double y, double width, double height) Draws a rectangle / background with a style matching vanilla tool tips.voidtoolTipBackground(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.voidtoolTipBackground(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.voidtoolTipWithImage(List<net.minecraft.network.chat.Component> tooltip, Optional<net.minecraft.world.inventory.tooltip.TooltipComponent> tooltipImage, double mouseX, double mouseY) voidtoolTipWithImage(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) voidtoolTipWithImage(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) voidtoolTipWithImage(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)
-
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
-
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
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.Only use this as a last resort! It may explode... Have fun!- Returns:
- A Vanilla GuiGraphics instance that wraps this
GuiRender
-
rect
Fill rectangle with solid colour -
rect
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
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 pixelstextureHeight- 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 pixelstextureHeight- Set base height of the sprite texture in pixels
-
texRect
Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area. -
texRect
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
Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area. -
texRect
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
Draws a texture sprite derived from the provided material. Texture will be resized / reshaped as appropriate to fit the defined area. -
tex
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
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
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
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
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
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
Draw centered string with shadow. (centered on x position) -
drawCenteredString
-
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 fromAbstractWidget.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 fromAbstractWidget.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
-
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
-
toolTipWithImage
-
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
-
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)
-