Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/kotlin/com/lambda/module/modules/render/BlockESP.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import com.lambda.module.tag.ModuleTag
import com.lambda.threading.runSafe
import com.lambda.util.extension.blockColor
import com.lambda.util.extension.getBlockState
import com.lambda.util.math.setAlpha
import com.lambda.util.world.toBlockPos
import net.minecraft.block.Blocks
import net.minecraft.client.render.model.BlockStateModel
Expand Down Expand Up @@ -77,12 +78,13 @@ object BlockESP : Module(

runSafe {
val extractedColor = blockColor(state, position.toBlockPos())
val finalColor = Color(extractedColor.red, extractedColor.green, extractedColor.blue, faceColor.alpha)
val pos = position.toBlockPos()
val shape = state.getOutlineShape(world, pos)
val worldBox = if (shape.isEmpty) Box(pos) else shape.boundingBox.offset(pos)
box(worldBox) {
if (drawFaces)
filled(if (useBlockColor) extractedColor else faceColor, sides)
filled(if (useBlockColor) finalColor else faceColor, sides)
if (drawOutlines)
outline(if (useBlockColor) extractedColor else BlockESP.outlineColor, sides, BlockESP.outlineMode)
}
Expand Down
11 changes: 9 additions & 2 deletions src/main/kotlin/com/lambda/util/extension/World.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,15 @@ fun SafeContext.collisionShape(state: BlockState, pos: BlockPos): VoxelShape =
fun SafeContext.outlineShape(state: BlockState, pos: BlockPos) =
state.getOutlineShape(world, pos).offset(pos)

fun SafeContext.blockColor(state: BlockState, pos: BlockPos) =
Color(state.getMapColor(world, pos).color)
fun SafeContext.blockColor(state: BlockState, pos: BlockPos): Color {
return when (state.block) {
Blocks.ENDER_CHEST -> Color(0xFF00FF)
Blocks.NETHER_PORTAL -> Color(0xaa00aa)
Blocks.END_PORTAL -> Color(0xFF00FF)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think pink is not the right color for end portal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks "darker" when the alpha is set to something, if you want it to be something entirely different do you want to suggest something?
2025-12-22_18 04 06

else ->
Color(state.getMapColor(world, pos).color, false)
}
}

fun World.getBlockState(x: Int, y: Int, z: Int): BlockState {
if (isOutOfHeightLimit(y)) return Blocks.VOID_AIR.defaultState
Expand Down