Skip to content

Commit ac62f82

Browse files
committed
Separate slider for alpha when using block color extraction.
1 parent 2cb074b commit ac62f82

File tree

1 file changed

+3
-2
lines changed
  • src/main/kotlin/com/lambda/module/modules/render

1 file changed

+3
-2
lines changed

src/main/kotlin/com/lambda/module/modules/render/BlockESP.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import com.lambda.module.tag.ModuleTag
2929
import com.lambda.threading.runSafe
3030
import com.lambda.util.extension.blockColor
3131
import com.lambda.util.extension.getBlockState
32-
import com.lambda.util.math.setAlpha
3332
import com.lambda.util.world.toBlockPos
3433
import net.minecraft.block.Blocks
3534
import net.minecraft.client.render.model.BlockStateModel
@@ -51,6 +50,8 @@ object BlockESP : Module(
5150
private val mesh by setting("Mesh", true, "Connect similar adjacent blocks") { searchBlocks }.onValueChange(::rebuildMesh)
5251

5352
private val useBlockColor by setting("Use Block Color", false, "Use the color of the block instead") { searchBlocks }.onValueChange(::rebuildMesh)
53+
private val blockColorAlpha by setting("Block Color Alpha", 0.3, 0.1..1.0, 0.05) { searchBlocks && useBlockColor }.onValueChange { _, _ -> ::rebuildMesh }
54+
5455
private val faceColor by setting("Face Color", Color(100, 150, 255, 51), "Color of the surfaces") { searchBlocks && drawFaces && !useBlockColor }.onValueChange(::rebuildMesh)
5556
private val outlineColor by setting("Outline Color", Color(100, 150, 255, 128), "Color of the outlines") { searchBlocks && drawOutlines && !useBlockColor }.onValueChange(::rebuildMesh)
5657

@@ -78,7 +79,7 @@ object BlockESP : Module(
7879

7980
runSafe {
8081
val extractedColor = blockColor(state, position.toBlockPos())
81-
val finalColor = Color(extractedColor.red, extractedColor.green, extractedColor.blue, faceColor.alpha)
82+
val finalColor = Color(extractedColor.red, extractedColor.green, extractedColor.blue, (blockColorAlpha * 255).toInt())
8283
val pos = position.toBlockPos()
8384
val shape = state.getOutlineShape(world, pos)
8485
val worldBox = if (shape.isEmpty) Box(pos) else shape.boundingBox.offset(pos)

0 commit comments

Comments
 (0)