Skip to content

Commit e63ad91

Browse files
committed
added blockpos mesh builder
1 parent 5b2f59b commit e63ad91

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

common/src/main/kotlin/com/lambda/graphics/renderer/esp/DirectionMask.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package com.lambda.graphics.renderer.esp
1919

2020
import com.lambda.util.world.FastVector
2121
import com.lambda.util.world.offset
22+
import com.lambda.util.world.toBlockPos
23+
import com.lambda.util.world.toFastVec
2224
import net.minecraft.util.math.BlockPos
2325
import net.minecraft.util.math.Direction
2426

@@ -41,6 +43,9 @@ object DirectionMask {
4143
fun Int.exclude(direction: Direction) = exclude(direction.mask)
4244
fun Int.hasDirection(dir: Int) = (this and dir) != 0
4345

46+
fun buildSideMesh(position: BlockPos, filter: (BlockPos) -> Boolean) =
47+
buildSideMesh(position.toFastVec()) { filter(it.toBlockPos()) }
48+
4449
fun buildSideMesh(position: FastVector, filter: (FastVector) -> Boolean): Int {
4550
var sides = ALL
4651

0 commit comments

Comments
 (0)