Class RenderUtil

java.lang.Object
info.u_team.u_team_core.util.RenderUtil

public class RenderUtil extends Object
Utility methods for rendering
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Extended matrix that adds getters and setters for all matrix values
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final RGBA
     
    static final RGBA
     
    static final RGBA
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addColoredQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, RGBA color, float blitOffset)
    Adds a quad to the buffer builder.
    static void
    addQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float blitOffset)
    Adds a quad to the buffer builder.
    static void
    addTexturedQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset)
    Adds a textured quad to the buffer builder.
    static void
    addTexturedRect(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int u, int v, float uScale, float vScale, int width, int height, float blitOffset)
    Adds a textured rectangle to the buffer builder.
    static void
    drawContainerBorder(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, RGBA color)
    Draws the default container border
    static void
    drawContinuousTexturedBox(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color)
    Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.
    static void
    drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color)
    Draws a textured quad.
    static void
    drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, RGBA color)
    Draws a textured quad.
    static void
    drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int uWidth, int vHeight, float uOffset, float vOffset, int textureWidth, int textureHeight, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color)
    Draws a textured quad.
    static void
    Sets the shader color from RGBA type

    Methods inherited from class java.lang.Object

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

    • DARK_CONTAINER_BORDER_COLOR

      public static final RGBA DARK_CONTAINER_BORDER_COLOR
    • MEDIUM_CONTAINER_BORDER_COLOR

      public static final RGBA MEDIUM_CONTAINER_BORDER_COLOR
    • BRIGHT_CONTAINER_BORDER_COLOR

      public static final RGBA BRIGHT_CONTAINER_BORDER_COLOR
  • Constructor Details

    • RenderUtil

      public RenderUtil()
  • Method Details

    • drawContainerBorder

      public static void drawContainerBorder(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, RGBA color)
      Draws the default container border
      Parameters:
      poseStack - Pose stack
      x - X coordinate
      y - Y coordinate
      width - Width
      height - Height
      blitOffset - zLevel for drawing
      color - The shader color. If using RGBA.WHITE then the drawing will not be colored
    • drawContinuousTexturedBox

      public static void drawContinuousTexturedBox(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight, int topBorder, int bottomBorder, int leftBorder, int rightBorder, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color)
      Draws a textured box of any size (smallest size is borderSize * 2 square) based on a fixed size textured box with continuous borders and filler.
      Parameters:
      poseStack - Pose stack
      x - X coordinate
      y - Y coordinate
      u - U coordinate
      v - V coordinate
      width - Width
      height - Height
      textureWidth - Texture width
      textureHeight - Texture height
      topBorder - Top border
      bottomBorder - Bottom border
      leftBorder - Left border
      rightBorder - Right border
      blitOffset - zLevel for drawing
      texture - Texture location
      color - The shader color. If using RGBA.WHITE then the image will not be colored
    • drawTexturedQuad

      public static void drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, int uWidth, int vHeight, float uOffset, float vOffset, int textureWidth, int textureHeight, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color)
      Draws a textured quad.
      Parameters:
      poseStack - Pose stack
      x - X coordinate
      y - Y coordinate
      width - Width
      height - Height
      uWidth - U Width
      vHeight - V Height
      uOffset - U Offset
      vOffset - V Offset
      textureWidth - Texture width
      textureHeight - Texture height
      blitOffset - zLevel for drawing
      texture - Texture location
      color - The shader color. If using RGBA.WHITE then the image will not be colored
    • drawTexturedQuad

      public static void drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int width, int height, float blitOffset, net.minecraft.client.renderer.texture.TextureAtlasSprite sprite, RGBA color)
      Draws a textured quad.
      Parameters:
      poseStack - Pose stack
      x - X coordinate
      y - Y coordinate
      width - Width
      height - Height
      blitOffset - zLevel for drawing
      sprite - Texture sprite from texture atlas
      color - The shader color. If using RGBA.WHITE then the image will not be colored
    • drawTexturedQuad

      public static void drawTexturedQuad(com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset, net.minecraft.resources.ResourceLocation texture, RGBA color)
      Draws a textured quad.
      Parameters:
      poseStack - Pose stack
      x1 - X1 coordinate
      x2 - X2 coordinate
      y1 - Y1 coordinate
      y2 - Y2 coordinate
      u1 - U1 coordinate
      u2 - U2 coordinate
      v1 - V1 coordinate
      v2 - V2 coordinate
      blitOffset - zLevel for drawing
      texture - Texture location
      color - The shader color. If using RGBA.WHITE then the image will not be colored
    • addTexturedRect

      public static void addTexturedRect(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x, int y, int u, int v, float uScale, float vScale, int width, int height, float blitOffset)
      Adds a textured rectangle to the buffer builder. The vertex format must be DefaultVertexFormat.POSITION_TEX and the draw format must be VertexFormat.Mode.QUADS
      Parameters:
      bufferBuilder - Buffer builder
      poseStack - Pose stack
      x - X coordinate
      y - Y coordinate
      u - U coordinate
      v - V coordinate
      uScale - U scale
      vScale - V scale
      width - Width
      height - Height
      blitOffset - zLevel for drawing
    • addTexturedQuad

      public static void addTexturedQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float u1, float u2, float v1, float v2, float blitOffset)
      Adds a textured quad to the buffer builder. The vertex format must be DefaultVertexFormat.POSITION_TEX and the draw format must be VertexFormat.Mode.QUADS
      Parameters:
      bufferBuilder - Buffer builder
      poseStack - Pose stack
      x1 - X1 coordinate
      x2 - X2 coordinate
      y1 - Y1 coordinate
      y2 - Y2 coordinate
      u1 - U1 coordinate
      u2 - U2 coordinate
      v1 - V1 coordinate
      v2 - V2 coordinate
      blitOffset - zLevel for drawing
    • addColoredQuad

      public static void addColoredQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, RGBA color, float blitOffset)
      Adds a quad to the buffer builder. The vertex format must be DefaultVertexFormat.POSITION_COLOR and the draw format must be VertexFormat.Mode.QUADS
      Parameters:
      bufferBuilder - Buffer builder
      poseStack - Pose stack
      x1 - X1 coordinate
      x2 - X2 coordinate
      y1 - Y1 coordinate
      y2 - Y2 coordinate
      color - Color of the vertices
      blitOffset - zLevel for drawing
    • addQuad

      public static void addQuad(com.mojang.blaze3d.vertex.BufferBuilder bufferBuilder, com.mojang.blaze3d.vertex.PoseStack poseStack, int x1, int x2, int y1, int y2, float blitOffset)
      Adds a quad to the buffer builder. The vertex format must be DefaultVertexFormat.POSITION and the draw format must be VertexFormat.Mode.QUADS
      Parameters:
      bufferBuilder - Buffer builder
      poseStack - Pose stack
      x1 - X1 coordinate
      x2 - X2 coordinate
      y1 - Y1 coordinate
      y2 - Y2 coordinate
      blitOffset - zLevel for drawing
    • setShaderColor

      public static void setShaderColor(RGBA rgba)
      Sets the shader color from RGBA type
      Parameters:
      rgba - Color