Class WorldDrawer

java.lang.Object
dev.boze.api.render.WorldDrawer

public class WorldDrawer extends Object
World rendering API for drawing 3D boxes in the world

Provides methods for rendering boxes in 3D world space

All drawing operations must be wrapped between start() and draw(MatrixStack, Framebuffer) calls

You can, of course, draw more than one box per start/draw call
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    box(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a full box with both sides and outline using ColorOption.Value
    static void
    box(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
    Renders a full box with both sides and outline using ColorOption.Value
    static void
    box(ClientColor color, float fillOpacity, float outlineOpacity, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a full box with both sides and outline
    static void
    box(ClientColor color, float fillOpacity, float outlineOpacity, net.minecraft.util.math.Box box)
    Renders a full box with both sides and outline
    static void
    boxLines(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box outline lines using ColorOption.Value
    static void
    boxLines(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
    Renders box outline lines using ColorOption.Value
    static void
    boxLines(ClientColor color, float opacity, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box outline lines
    static void
    boxLines(ClientColor color, float opacity, net.minecraft.util.math.Box box)
    Renders box outline lines
    static void
    boxSides(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box sides/faces using ColorOption.Value
    static void
    boxSides(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
    Renders box sides/faces using ColorOption.Value
    static void
    boxSides(ClientColor color, float opacity, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box sides/faces
    static void
    boxSides(ClientColor color, float opacity, net.minecraft.util.math.Box box)
    Renders box sides/faces
    static void
    draw(net.minecraft.client.util.math.MatrixStack matrices)
    Renders the current drawing session to the main vanilla framebuffer
    static void
    draw(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.gl.Framebuffer framebuffer)
    Renders the current drawing session to the specified framebuffer
    static void
    dynamicBox(ColorOption.Value colorOption, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a full box dynamically based on shader setting using ColorOption.Value
    static void
    dynamicBox(ColorOption.Value colorOption, boolean useShader, net.minecraft.util.math.Box box)
    Renders a full box dynamically based on shader setting using ColorOption.Value
    static void
    dynamicBox(ClientColor color, float fillOpacity, float outlineOpacity, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a full box dynamically based on shader setting
    static void
    dynamicBox(ClientColor color, float fillOpacity, float outlineOpacity, boolean useShader, net.minecraft.util.math.Box box)
    Renders a full box dynamically based on shader setting
    static void
    dynamicBoxSides(ColorOption.Value colorOption, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box sides dynamically based on shader setting using ColorOption.Value
    static void
    dynamicBoxSides(ColorOption.Value colorOption, boolean useShader, net.minecraft.util.math.Box box)
    Renders box sides dynamically based on shader setting using ColorOption.Value
    static void
    dynamicBoxSides(ClientColor color, float opacity, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box sides dynamically based on shader setting
    static void
    dynamicBoxSides(ClientColor color, float opacity, boolean useShader, net.minecraft.util.math.Box box)
    Renders box sides dynamically based on shader setting
    static void
    dynamicSide(ColorOption.Value colorOption, boolean useShader, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a single box side/face dynamically based on shader setting using ColorOption.Value
    static void
    dynamicSide(ClientColor color, float opacity, boolean useShader, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a single box side/face dynamically based on shader setting
    static void
    shaderBoxSides(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box sides/faces using shader with ColorOption.Value
    static void
    shaderBoxSides(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
    Renders box sides/faces using shader with ColorOption.Value
    static void
    shaderBoxSides(ClientColor color, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders box sides/faces using shader
    static void
    shaderBoxSides(ClientColor color, net.minecraft.util.math.Box box)
    Renders box sides/faces using shader
    static void
    shaderSide(ColorOption.Value colorOption, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a single box side/face using shader with ColorOption.Value
    static void
    shaderSide(ClientColor color, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a single box side/face using shader
    static void
    side(ColorOption.Value colorOption, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a single box side/face using ColorOption.Value
    static void
    side(ClientColor color, float opacity, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
    Renders a single box side/face
    static void
    Starts a new world rendering session

    Methods inherited from class java.lang.Object

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

    • WorldDrawer

      public WorldDrawer()
  • Method Details

    • start

      public static void start()
      Starts a new world rendering session

      Must be called before any non-shader drawing operations. Shader methods (shaderBoxSides, shaderSide, and dynamic methods when useShader=true) do not require start/draw. Throws RuntimeException if already started
    • draw

      public static void draw(net.minecraft.client.util.math.MatrixStack matrices)
      Renders the current drawing session to the main vanilla framebuffer

      Must be called after non-shader drawing operations. Shader methods (shaderBoxSides, shaderSide, and dynamic methods when useShader=true) do not require start/draw. Throws RuntimeException if start() was not called first
      Parameters:
      matrices - The matrix stack for rendering
    • draw

      public static void draw(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.gl.Framebuffer framebuffer)
      Renders the current drawing session to the specified framebuffer

      Must be called after non-shader drawing operations. Shader methods (shaderBoxSides, shaderSide, and dynamic methods when useShader=true) do not require start/draw. Throws RuntimeException if start() was not called first
      Parameters:
      matrices - The matrix stack for rendering
      framebuffer - The framebuffer to render to
    • box

      public static void box(ClientColor color, float fillOpacity, float outlineOpacity, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a full box with both sides and outline

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      fillOpacity - The opacity for filled sides
      outlineOpacity - The opacity for outline lines
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • box

      public static void box(ClientColor color, float fillOpacity, float outlineOpacity, net.minecraft.util.math.Box box)
      Renders a full box with both sides and outline

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      fillOpacity - The opacity for filled sides
      outlineOpacity - The opacity for outline lines
      box - The box to render
    • boxLines

      public static void boxLines(ClientColor color, float opacity, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box outline lines

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      opacity - The opacity value
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • boxLines

      public static void boxLines(ClientColor color, float opacity, net.minecraft.util.math.Box box)
      Renders box outline lines

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      opacity - The opacity value
      box - The box to render lines for
    • boxSides

      public static void boxSides(ClientColor color, float opacity, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box sides/faces

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      opacity - The opacity value
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • boxSides

      public static void boxSides(ClientColor color, float opacity, net.minecraft.util.math.Box box)
      Renders box sides/faces

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      opacity - The opacity value
      box - The box to render sides for
    • side

      public static void side(ClientColor color, float opacity, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a single box side/face

      Throws RuntimeException if start() was not called first
      Parameters:
      color - The color to use
      opacity - The opacity value
      direction - The direction of the side to render (use Dir constants)
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • box

      public static void box(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a full box with both sides and outline using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • box

      public static void box(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
      Renders a full box with both sides and outline using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      box - The box to render
    • boxLines

      public static void boxLines(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box outline lines using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • boxLines

      public static void boxLines(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
      Renders box outline lines using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      box - The box to render lines for
    • boxSides

      public static void boxSides(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box sides/faces using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • boxSides

      public static void boxSides(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
      Renders box sides/faces using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      box - The box to render sides for
    • side

      public static void side(ColorOption.Value colorOption, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a single box side/face using ColorOption.Value

      Throws RuntimeException if start() was not called first
      Parameters:
      colorOption - The color option value containing color and opacity settings
      direction - The direction of the side to render (use Dir constants)
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • shaderBoxSides

      public static void shaderBoxSides(ClientColor color, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box sides/faces using shader

      Does not require start/draw calls. Uses opacity 1F for shader rendering
      Parameters:
      color - The color to use
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • shaderBoxSides

      public static void shaderBoxSides(ClientColor color, net.minecraft.util.math.Box box)
      Renders box sides/faces using shader

      Does not require start/draw calls. Uses opacity 1F for shader rendering
      Parameters:
      color - The color to use
      box - The box to render sides for
    • shaderSide

      public static void shaderSide(ClientColor color, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a single box side/face using shader

      Does not require start/draw calls. Uses opacity 1F for shader rendering
      Parameters:
      color - The color to use
      direction - The direction of the side to render (use Dir constants)
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • shaderBoxSides

      public static void shaderBoxSides(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box sides/faces using shader with ColorOption.Value

      Does not require start/draw calls. Uses opacity 1F for shader rendering
      Parameters:
      colorOption - The color option value containing color settings
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • shaderBoxSides

      public static void shaderBoxSides(ColorOption.Value colorOption, net.minecraft.util.math.Box box)
      Renders box sides/faces using shader with ColorOption.Value

      Does not require start/draw calls. Uses opacity 1F for shader rendering
      Parameters:
      colorOption - The color option value containing color settings
      box - The box to render sides for
    • shaderSide

      public static void shaderSide(ColorOption.Value colorOption, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a single box side/face using shader with ColorOption.Value

      Does not require start/draw calls. Uses opacity 1F for shader rendering
      Parameters:
      colorOption - The color option value containing color settings
      direction - The direction of the side to render (use Dir constants)
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • dynamicBox

      public static void dynamicBox(ClientColor color, float fillOpacity, float outlineOpacity, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a full box dynamically based on shader setting

      If useShader is true, renders only sides using shader (no lines). If useShader is false, renders full box with sides and lines. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      color - The color to use
      fillOpacity - The opacity for filled sides
      outlineOpacity - The opacity for outline lines (ignored if useShader is true)
      useShader - Whether to use shader rendering
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • dynamicBox

      public static void dynamicBox(ClientColor color, float fillOpacity, float outlineOpacity, boolean useShader, net.minecraft.util.math.Box box)
      Renders a full box dynamically based on shader setting

      If useShader is true, renders only sides using shader (no lines). If useShader is false, renders full box with sides and lines. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      color - The color to use
      fillOpacity - The opacity for filled sides
      outlineOpacity - The opacity for outline lines (ignored if useShader is true)
      useShader - Whether to use shader rendering
      box - The box to render
    • dynamicBoxSides

      public static void dynamicBoxSides(ClientColor color, float opacity, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box sides dynamically based on shader setting

      If useShader is true, uses shader rendering. If useShader is false, uses regular rendering. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      color - The color to use
      opacity - The opacity value
      useShader - Whether to use shader rendering
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • dynamicBoxSides

      public static void dynamicBoxSides(ClientColor color, float opacity, boolean useShader, net.minecraft.util.math.Box box)
      Renders box sides dynamically based on shader setting

      If useShader is true, uses shader rendering. If useShader is false, uses regular rendering. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      color - The color to use
      opacity - The opacity value
      useShader - Whether to use shader rendering
      box - The box to render sides for
    • dynamicBox

      public static void dynamicBox(ColorOption.Value colorOption, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a full box dynamically based on shader setting using ColorOption.Value

      If useShader is true, renders only sides using shader (no lines). If useShader is false, renders full box with sides and lines. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      colorOption - The color option value containing color and opacity settings
      useShader - Whether to use shader rendering
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • dynamicBox

      public static void dynamicBox(ColorOption.Value colorOption, boolean useShader, net.minecraft.util.math.Box box)
      Renders a full box dynamically based on shader setting using ColorOption.Value

      If useShader is true, renders only sides using shader (no lines). If useShader is false, renders full box with sides and lines. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      colorOption - The color option value containing color and opacity settings
      useShader - Whether to use shader rendering
      box - The box to render
    • dynamicBoxSides

      public static void dynamicBoxSides(ColorOption.Value colorOption, boolean useShader, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders box sides dynamically based on shader setting using ColorOption.Value

      If useShader is true, uses shader rendering. If useShader is false, uses regular rendering. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      colorOption - The color option value containing color and opacity settings
      useShader - Whether to use shader rendering
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • dynamicBoxSides

      public static void dynamicBoxSides(ColorOption.Value colorOption, boolean useShader, net.minecraft.util.math.Box box)
      Renders box sides dynamically based on shader setting using ColorOption.Value

      If useShader is true, uses shader rendering. If useShader is false, uses regular rendering. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      colorOption - The color option value containing color and opacity settings
      useShader - Whether to use shader rendering
      box - The box to render sides for
    • dynamicSide

      public static void dynamicSide(ClientColor color, float opacity, boolean useShader, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a single box side/face dynamically based on shader setting

      If useShader is true, uses shader rendering. If useShader is false, uses regular rendering. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      color - The color to use
      opacity - The opacity value
      useShader - Whether to use shader rendering
      direction - The direction of the side to render (use Dir constants)
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate
    • dynamicSide

      public static void dynamicSide(ColorOption.Value colorOption, boolean useShader, byte direction, double x1, double y1, double z1, double x2, double y2, double z2)
      Renders a single box side/face dynamically based on shader setting using ColorOption.Value

      If useShader is true, uses shader rendering. If useShader is false, uses regular rendering. Throws RuntimeException if start() was not called first and useShader is false
      Parameters:
      colorOption - The color option value containing color and opacity settings
      useShader - Whether to use shader rendering
      direction - The direction of the side to render (use Dir constants)
      x1 - Minimum X coordinate
      y1 - Minimum Y coordinate
      z1 - Minimum Z coordinate
      x2 - Maximum X coordinate
      y2 - Maximum Y coordinate
      z2 - Maximum Z coordinate