PlacementRenderHandler

class PlacementRenderHandler(placementRenderer: PlacementRenderer, val id: Int = 0) : BlockCuller.Owner

A renderer instance that can be added to a PlacementRenderer, it contains the core logic. Culling is handled in each handler for its boxes individually.

This class is not thread-safe. You can use it on the render thread. (the most recommended way)

Constructors

Link copied to clipboard
constructor(placementRenderer: PlacementRenderer, id: Int = 0)

Properties

Link copied to clipboard
val id: Int

Functions

Link copied to clipboard
fun addBlock(pos: BlockPos, update: Boolean = true, box: AABB = FULL_BOX)

Adds a block to be rendered. First it will make an appear-animation, then it will continue to get rendered until it's removed or the world changes.

Link copied to clipboard
fun clear()

Removes all stored positions.

Link copied to clipboard

Puts all currently rendered positions in the out-animation state and keeps it being rendered until all animations have been finished even though the module might be already disabled.

Link copied to clipboard
open operator override fun contains(pos: Long): Boolean

Checks whether the position (in long value) is rendered.

Link copied to clipboard
Link copied to clipboard
fun removeBlock(pos: BlockPos)

Removes a block from the rendering, it will get an out animation tho.

Link copied to clipboard
fun render(event: WorldRenderEvent, time: Long)
Link copied to clipboard
fun updateAll()

Updates all culling data.

Link copied to clipboard
fun updateBox(pos: BlockPos, box: AABB)

Updates the box of pos to box.