Package dev.boze.api.render
Class WorldDrawer
java.lang.Object
dev.boze.api.render.WorldDrawer
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbox(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.Valuestatic voidbox(ColorOption.Value colorOption, net.minecraft.util.math.Box box) Renders a full box with both sides and outline using ColorOption.Valuestatic voidbox(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 outlinestatic voidbox(ClientColor color, float fillOpacity, float outlineOpacity, net.minecraft.util.math.Box box) Renders a full box with both sides and outlinestatic voidboxLines(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2) Renders box outline lines using ColorOption.Valuestatic voidboxLines(ColorOption.Value colorOption, net.minecraft.util.math.Box box) Renders box outline lines using ColorOption.Valuestatic voidboxLines(ClientColor color, float opacity, double x1, double y1, double z1, double x2, double y2, double z2) Renders box outline linesstatic voidboxLines(ClientColor color, float opacity, net.minecraft.util.math.Box box) Renders box outline linesstatic voidboxSides(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2) Renders box sides/faces using ColorOption.Valuestatic voidboxSides(ColorOption.Value colorOption, net.minecraft.util.math.Box box) Renders box sides/faces using ColorOption.Valuestatic voidboxSides(ClientColor color, float opacity, double x1, double y1, double z1, double x2, double y2, double z2) Renders box sides/facesstatic voidboxSides(ClientColor color, float opacity, net.minecraft.util.math.Box box) Renders box sides/facesstatic voiddraw(net.minecraft.client.util.math.MatrixStack matrices) Renders the current drawing session to the main vanilla framebufferstatic voiddraw(net.minecraft.client.util.math.MatrixStack matrices, net.minecraft.client.gl.Framebuffer framebuffer) Renders the current drawing session to the specified framebufferstatic voiddynamicBox(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.Valuestatic voiddynamicBox(ColorOption.Value colorOption, boolean useShader, net.minecraft.util.math.Box box) Renders a full box dynamically based on shader setting using ColorOption.Valuestatic voiddynamicBox(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 settingstatic voiddynamicBox(ClientColor color, float fillOpacity, float outlineOpacity, boolean useShader, net.minecraft.util.math.Box box) Renders a full box dynamically based on shader settingstatic voiddynamicBoxSides(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.Valuestatic voiddynamicBoxSides(ColorOption.Value colorOption, boolean useShader, net.minecraft.util.math.Box box) Renders box sides dynamically based on shader setting using ColorOption.Valuestatic voiddynamicBoxSides(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 settingstatic voiddynamicBoxSides(ClientColor color, float opacity, boolean useShader, net.minecraft.util.math.Box box) Renders box sides dynamically based on shader settingstatic voiddynamicSide(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.Valuestatic voiddynamicSide(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 settingstatic voidshaderBoxSides(ColorOption.Value colorOption, double x1, double y1, double z1, double x2, double y2, double z2) Renders box sides/faces using shader with ColorOption.Valuestatic voidshaderBoxSides(ColorOption.Value colorOption, net.minecraft.util.math.Box box) Renders box sides/faces using shader with ColorOption.Valuestatic voidshaderBoxSides(ClientColor color, double x1, double y1, double z1, double x2, double y2, double z2) Renders box sides/faces using shaderstatic voidshaderBoxSides(ClientColor color, net.minecraft.util.math.Box box) Renders box sides/faces using shaderstatic voidshaderSide(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.Valuestatic voidshaderSide(ClientColor color, byte direction, double x1, double y1, double z1, double x2, double y2, double z2) Renders a single box side/face using shaderstatic voidside(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.Valuestatic voidside(ClientColor color, float opacity, byte direction, double x1, double y1, double z1, double x2, double y2, double z2) Renders a single box side/facestatic voidstart()Starts a new world rendering session
-
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 renderingframebuffer- 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 usefillOpacity- The opacity for filled sidesoutlineOpacity- The opacity for outline linesx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 usefillOpacity- The opacity for filled sidesoutlineOpacity- The opacity for outline linesbox- 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 useopacity- The opacity valuex1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
boxLines
Renders box outline lines Throws RuntimeException if start() was not called first- Parameters:
color- The color to useopacity- The opacity valuebox- 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 useopacity- The opacity valuex1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
boxSides
Renders box sides/faces Throws RuntimeException if start() was not called first- Parameters:
color- The color to useopacity- The opacity valuebox- 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 useopacity- The opacity valuedirection- The direction of the side to render (use Dir constants)x1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 settingsx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
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 settingsbox- 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 settingsx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
boxLines
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 settingsbox- 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 settingsx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
boxSides
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 settingsbox- 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 settingsdirection- The direction of the side to render (use Dir constants)x1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 usex1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
shaderBoxSides
Renders box sides/faces using shader Does not require start/draw calls. Uses opacity 1F for shader rendering- Parameters:
color- The color to usebox- 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 usedirection- The direction of the side to render (use Dir constants)x1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 settingsx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-
shaderBoxSides
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 settingsbox- 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 settingsdirection- The direction of the side to render (use Dir constants)x1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 usefillOpacity- The opacity for filled sidesoutlineOpacity- The opacity for outline lines (ignored if useShader is true)useShader- Whether to use shader renderingx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 usefillOpacity- The opacity for filled sidesoutlineOpacity- The opacity for outline lines (ignored if useShader is true)useShader- Whether to use shader renderingbox- 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 useopacity- The opacity valueuseShader- Whether to use shader renderingx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 useopacity- The opacity valueuseShader- Whether to use shader renderingbox- 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 settingsuseShader- Whether to use shader renderingx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 settingsuseShader- Whether to use shader renderingbox- 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 settingsuseShader- Whether to use shader renderingx1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 settingsuseShader- Whether to use shader renderingbox- 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 useopacity- The opacity valueuseShader- Whether to use shader renderingdirection- The direction of the side to render (use Dir constants)x1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- 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 settingsuseShader- Whether to use shader renderingdirection- The direction of the side to render (use Dir constants)x1- Minimum X coordinatey1- Minimum Y coordinatez1- Minimum Z coordinatex2- Maximum X coordinatey2- Maximum Y coordinatez2- Maximum Z coordinate
-