@@ -20,11 +20,45 @@ package com.lambda.graphics.renderer.esp.builders
2020import com.lambda.graphics.renderer.esp.DirectionMask
2121import com.lambda.graphics.renderer.esp.DirectionMask.hasDirection
2222import com.lambda.graphics.renderer.esp.impl.StaticESPRenderer
23+ import com.lambda.threading.runSafe
24+ import com.lambda.util.BlockUtils.blockState
2325import com.lambda.util.extension.max
2426import com.lambda.util.extension.min
27+ import net.minecraft.block.BlockState
28+ import net.minecraft.util.math.BlockPos
2529import net.minecraft.util.math.Box
30+ import net.minecraft.util.shape.VoxelShape
2631import java.awt.Color
2732
33+ fun StaticESPRenderer.buildVoxel (
34+ pos : BlockPos ,
35+ state : BlockState ,
36+ color : Color ,
37+ sides : Int = DirectionMask .ALL ,
38+ ) = runSafe {
39+ val shape = state.getOutlineShape(world, pos)
40+ buildVoxel(shape, color, sides)
41+ }
42+
43+ fun StaticESPRenderer.buildVoxel (
44+ pos : BlockPos ,
45+ color : Color ,
46+ sides : Int = DirectionMask .ALL ,
47+ ) = runSafe {
48+ val shape = pos.blockState(world).getOutlineShape(world, pos)
49+ buildVoxel(shape, color, sides)
50+ }
51+
52+ fun StaticESPRenderer.buildVoxel (
53+ shape : VoxelShape ,
54+ color : Color ,
55+ sides : Int = DirectionMask .ALL ,
56+ ) {
57+ shape.boundingBoxes
58+ .forEach { buildFilled(it, color, sides) }
59+ }
60+
61+
2862fun StaticESPRenderer.build (
2963 box : Box ,
3064 filledColor : Color ,
0 commit comments