WorldRenderUtils

A Collection of Methods for Rendering within the 3D World.

This class provides methods for rendering shapes in the 3D in-game world.

The phase Parameter

To control whether objects should be visible through walls you can use the phase parameter. This will disable the depth test.

The relocate Parameter

Depending on when methods in here are called in the rendering process, coordinates may or may not be already translated by the camera position. To account for this most methods have a relocate parameter. In general, like when using the RenderWorldLastEvent, this should be set to true for the expected behaviour.

Author

Aton

Stivais

Functions

Link copied to clipboard
fun drawBoxAtBlock(blockPos: BlockPos, color: Color, thickness: Float = 3.0f, relocate: Boolean = true)

Draws a cube outline for the block at the given blockPos.

fun drawBoxAtBlock(x: Double, y: Double, z: Double, color: Color, thickness: Float = 3.0f, relocate: Boolean = true)

Draws a cube outline of size 1 starting at x, y, z which extends by 1 along the axes in positive direction.

Link copied to clipboard
fun drawBoxByEntity(entity: Entity, color: Color, width: Double, height: Double, partialTicks: Float = 0.0f, lineWidth: Double = 2.0, phase: Boolean = false, xOffset: Double = 0.0, yOffset: Double = 0.0, zOffset: Double = 0.0)
fun drawBoxByEntity(entity: Entity, color: Color, width: Float, height: Float, partialTicks: Float = 0.0f, lineWidth: Float = 2.0f, phase: Boolean = false, xOffset: Double = 0.0, yOffset: Double = 0.0, zOffset: Double = 0.0)

Draws a rectangular cuboid outline (box) around the entity.

Link copied to clipboard
fun drawCustomSizedBoxAt(x: Double, y: Double, z: Double, size: Double, color: Color, thickness: Float = 3.0f, phase: Boolean = true, relocate: Boolean = true)

Draws a cube outline starting at x, y, z which extends by size into the positive direction along those axes.

fun drawCustomSizedBoxAt(x: Double, y: Double, z: Double, xWidth: Double, yHeight: Double, zWidth: Double, color: Color, thickness: Float = 3.0f, phase: Boolean = true, relocate: Boolean = true)

Draws a cube outline starting at x, y, z which extends by xWidth, yHeight, zWidth into the positive direction along the respective axes.

Link copied to clipboard
fun drawLine(start: Vec3, finish: Vec3, color: Color, thickness: Float = 3.0f, phase: Boolean = true)

Draws a line connecting the points start and finish.

fun drawLine(x: Double, y: Double, z: Double, x2: Double, y2: Double, z2: Double, color: Color, thickness: Float = 3.0f, phase: Boolean = true)

Draws a line connecting the points (x, y, z) and (x2, y2, z2).