Skip to content

Commit 19975c8

Browse files
committed
RadiusESP and render settings cleanup
1 parent ba6934e commit 19975c8

12 files changed

Lines changed: 178 additions & 42 deletions

File tree

src/main/kotlin/com/lambda/config/groups/BreakSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ open class BreakSettings(
3737
prefix: String = "",
3838
override val visibility: () -> Boolean = { true },
3939
) : SettingGroup(c), BreakConfig {
40-
private enum class Group(override val displayName: String) : NamedEnum {
40+
enum class Group(override val displayName: String) : NamedEnum {
4141
General("General"),
4242
Cosmetic("Cosmetic")
4343
}

src/main/kotlin/com/lambda/config/groups/ScreenLineSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ScreenLineSettings(
2828
prefix: String = "",
2929
override val visibility: () -> Boolean = { true },
3030
) : SettingGroup(c), LineConfig {
31-
private enum class Group(override val displayName: String) : NamedEnum {
31+
enum class Group(override val displayName: String) : NamedEnum {
3232
Color("Color"),
3333
Dash("Dash")
3434
}

src/main/kotlin/com/lambda/config/groups/ScreenTextSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ScreenTextSettings(
2828
prefix: String = "",
2929
override val visibility: () -> Boolean = { true },
3030
) : SettingGroup(c), TextConfig {
31-
private enum class Group(override val displayName: String) : NamedEnum {
31+
enum class Group(override val displayName: String) : NamedEnum {
3232
General("General"),
3333
Outline("Outline"),
3434
Glow("Glow"),

src/main/kotlin/com/lambda/config/groups/WorldLineSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class WorldLineSettings(
2828
prefix: String = "",
2929
override val visibility: () -> Boolean = { true },
3030
) : SettingGroup(c), LineConfig {
31-
private enum class Group(override val displayName: String) : NamedEnum {
31+
enum class Group(override val displayName: String) : NamedEnum {
3232
General("General"),
3333
Color("Color"),
3434
Dash("Dash")

src/main/kotlin/com/lambda/config/groups/WorldTextSettings.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class WorldTextSettings(
2828
prefix: String = "",
2929
override val visibility: () -> Boolean = { true },
3030
) : SettingGroup(c), TextConfig {
31-
private enum class Group(override val displayName: String) : NamedEnum {
31+
enum class Group(override val displayName: String) : NamedEnum {
3232
General("General"),
3333
Outline("Outline"),
3434
Glow("Glow"),

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

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import com.lambda.graphics.mc.renderer.ImmediateRenderer.Companion.immediateRend
2626
import com.lambda.module.Module
2727
import com.lambda.module.tag.ModuleTag
2828
import com.lambda.util.BlockUtils.blockState
29+
import com.lambda.util.NamedEnum
2930
import com.lambda.util.extension.tickDelta
3031
import com.lambda.util.math.lerp
3132
import com.lambda.util.world.raycast.RayCastUtils.blockResult
@@ -37,20 +38,31 @@ object BlockOutline : Module(
3738
description = "Overrides the default block outline rendering",
3839
tag = ModuleTag.RENDER
3940
) {
41+
private enum class Mode {
42+
Boxes,
43+
Outline
44+
}
45+
46+
private enum class BoxGroup(override val displayName: String) : NamedEnum {
47+
Fill("Fill"),
48+
Outline("Outline")
49+
}
50+
4051
private val mode by setting("Mode", Mode.Boxes)
41-
private val fill by setting("Fill", true) { mode == Mode.Boxes }
42-
private val fillColor by setting("Fill Color", Color(255, 255, 255, 20)) { fill && mode == Mode.Boxes }
43-
private val boxOutline by setting("Box Outline", true) { mode == Mode.Boxes }
44-
private val boxOutlineColor by setting("Box Outline Color", Color(255, 255, 255, 120)) { boxOutline && mode == Mode.Boxes }
45-
private val lineConfig = WorldLineSettings(this, prefix = "Outline ") { boxOutline && mode == Mode.Boxes }.apply {
52+
private val interpolate by setting("Interpolate", true) { mode == Mode.Boxes }
53+
private val depthTest by setting("Depth Test", true)
54+
55+
private val fill by setting("Fill", true) { mode == Mode.Boxes }.group(BoxGroup.Fill)
56+
private val fillColor by setting("Fill Color", Color(255, 255, 255, 20)) { fill && mode == Mode.Boxes }.group(BoxGroup.Fill)
57+
private val boxOutline by setting("Box Outline", true) { mode == Mode.Boxes }.group(BoxGroup.Outline, WorldLineSettings.Group.General)
58+
private val boxOutlineColor by setting("Box Outline Color", Color(255, 255, 255, 120)) { boxOutline && mode == Mode.Boxes }.group(BoxGroup.Outline, WorldLineSettings.Group.General)
59+
private val lineConfig = WorldLineSettings(this, BoxGroup.Outline, prefix = "Outline ") { boxOutline && mode == Mode.Boxes }.apply {
4660
applyEdits {
4761
hide(::startColor, ::endColor)
4862
}
4963
}
50-
private val interpolate by setting("Interpolate", true) { mode == Mode.Boxes }
5164
private val outlineColor by setting("Outline Color", boxOutlineColor) { mode == Mode.Outline }
5265
private val outlineStyle = OutlineSettings(this, prefix = "Outline") { mode == Mode.Outline }
53-
private val depthTest by setting("Depth Test", true)
5466

5567
var previous: List<Box>? = null
5668

@@ -96,9 +108,4 @@ object BlockOutline : Module(
96108
.map { it.offset(hitResult.blockPos) }
97109
}
98110
}
99-
100-
private enum class Mode {
101-
Boxes,
102-
Outline
103-
}
104111
}

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ object ESP : Module(
3939
description = "Highlight entities with smooth interpolated rendering",
4040
tag = ModuleTag.RENDER
4141
) {
42-
private enum class Group(override val displayName: String): NamedEnum {
42+
private enum class Group(override val displayName: String) : NamedEnum {
4343
General("General"),
4444
Shader("Shader"),
4545
Box("Box"),
@@ -48,16 +48,21 @@ object ESP : Module(
4848
Colors("Colors")
4949
}
5050

51+
private enum class BoxGroup(override val displayName: String) : NamedEnum {
52+
Fill("Fill"),
53+
Outline("Outline")
54+
}
55+
5156
private val mode by setting("Mode", EspMode.Shader).group(Group.General)
5257
private val depthTest by setting("Depth Test", false, "Blend ESP renders into the world").group(Group.General)
5358

5459
private val outlineStyle = OutlineSettings(this, Group.Shader) { mode == EspMode.Shader }
5560

56-
private var drawFilled: Boolean by setting("Box Fill", true, "Fill entity boxes") { mode == EspMode.Box }.group(Group.Box)
61+
private var drawFilled: Boolean by setting("Box Fill", true, "Fill entity boxes") { mode == EspMode.Box }.group(Group.Box, BoxGroup.Fill)
5762
.onValueChange { _, to -> if (!to && !drawOutline) drawOutline = true }
58-
private var drawOutline: Boolean by setting("Box Outline", true, "Draw box outlines") { mode == EspMode.Box }.group(Group.Box)
63+
private var drawOutline: Boolean by setting("Box Outline", true, "Draw box outlines") { mode == EspMode.Box }.group(Group.Box, BoxGroup.Outline, WorldLineSettings.Group.General)
5964
.onValueChange { _, to -> if (!to && !drawFilled) drawFilled = true }
60-
private val boxOutlineSettings = WorldLineSettings(this, Group.Box) { mode == EspMode.Box && drawOutline }.apply {
65+
private val boxOutlineSettings = WorldLineSettings(this, Group.Box, BoxGroup.Outline) { mode == EspMode.Box && drawOutline }.apply {
6166
applyEdits {
6267
hide(::startColor, ::endColor)
6368
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ object LightLevels : Module(
6262
private val size by setting("Size", 14, 1..16).onValueChange(::refreshChunkedRenderer)
6363
private val fill by setting("Fill", false) { renderMode == RenderMode.Square }.group(Group.Fill).onValueChange(::refreshChunkedRenderer)
6464
private val fillAlpha by setting("Fill Alpha", 0.2, 0.0..1.0, 0.01) { renderMode == RenderMode.Square && fill }.group(Group.Fill).onValueChange(::refreshChunkedRenderer)
65-
private val outline by setting("Outline", true) { renderMode == RenderMode.Square }.group(Group.Line).onValueChange(::refreshChunkedRenderer)
66-
private val worldLineConfig = WorldLineSettings(c = this, Group.Line) { renderMode != RenderMode.Square || outline }.apply {
65+
private val outline by setting("Outline", true) { renderMode == RenderMode.Square }.group(Group.Line, WorldLineSettings.Group.General).onValueChange(::refreshChunkedRenderer)
66+
private val worldLineConfig = WorldLineSettings(this, Group.Line) { renderMode != RenderMode.Square || outline }.apply {
6767
applyEdits {
6868
hide(::startColor, ::endColor)
6969
settings.forEach { it.onValueChange(::refreshChunkedRenderer) }
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/*
2+
* Copyright 2026 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.module.modules.render
19+
20+
import com.lambda.config.applyEdits
21+
import com.lambda.config.groups.WorldLineSettings
22+
import com.lambda.context.SafeContext
23+
import com.lambda.graphics.mc.RenderBuilder
24+
import com.lambda.graphics.mc.renderer.ChunkedRenderer.Companion.chunkedRenderer
25+
import com.lambda.graphics.mc.renderer.ImmediateRenderer.Companion.immediateRenderer
26+
import com.lambda.module.Module
27+
import com.lambda.module.tag.ModuleTag
28+
import com.lambda.threading.runSafe
29+
import com.lambda.util.BlockUtils.blockState
30+
import com.lambda.util.NamedEnum
31+
import com.lambda.util.math.setAlpha
32+
import com.lambda.util.world.toBlockPos
33+
import net.minecraft.block.Blocks
34+
import net.minecraft.block.entity.BeaconBlockEntity
35+
import net.minecraft.util.math.Box
36+
import java.awt.Color
37+
38+
class RadiusESP : Module(
39+
name = "RadiusESP",
40+
description = "Shows the radius for blocks with abnormal functionality",
41+
tag = ModuleTag.RENDER
42+
) {
43+
private enum class Group(override val displayName: String) : NamedEnum {
44+
Blocks("Blocks"),
45+
Render("Render")
46+
}
47+
48+
private enum class RenderGroup(override val displayName: String) : NamedEnum {
49+
General("General"),
50+
Outline("Outline")
51+
}
52+
53+
private val beacons by setting("Beacons", true).group(Group.Blocks).onValueChange(::rebuildMesh)
54+
private val spawners by setting("Spawners", true).group(Group.Blocks).onValueChange(::rebuildMesh)
55+
56+
private val beaconColor by setting("Beacon Color", Color(0, 255, 255, 255)) { beacons }.group(Group.Render, RenderGroup.General).onValueChange(::rebuildMesh)
57+
private val spawnerColor by setting("Spawner Color", Color(255, 0, 0, 255)) { spawners }.group(Group.Render, RenderGroup.General).onValueChange(::rebuildMesh)
58+
private var fill: Boolean by setting("Fill", true).group(Group.Render, RenderGroup.General).onValueChange(::rebuildMesh)
59+
.onValueChange { _, to -> if (!to) outline = true }
60+
private var outline: Boolean by setting("Outline", true).group(Group.Render, RenderGroup.General).onValueChange(::rebuildMesh)
61+
.onValueChange { _, to -> if (!to) fill = true }
62+
private val fillAlpha by setting("Fill Alpha", 0.1, 0.0..1.0, 0.01).group(Group.Render, RenderGroup.General).onValueChange(::rebuildMesh)
63+
private val worldLineConfig = WorldLineSettings(this, Group.Render, RenderGroup.Outline) { outline }.apply {
64+
applyEdits {
65+
hide(::startColor, ::endColor)
66+
settings.forEach { it.onValueChange(::rebuildMesh) }
67+
}
68+
}
69+
70+
private val chunkedRenderer = chunkedRenderer("RadiusESP Chunked Renderer") { _, pos ->
71+
runSafe {
72+
val blockPos = pos.toBlockPos()
73+
val blockState = blockState(blockPos)
74+
if (blockState.block === Blocks.SPAWNER && spawners) {
75+
val center = blockPos.toCenterPos()
76+
val box = Box(center, center).expand(16.0)
77+
renderBox(box, spawnerColor)
78+
}
79+
}
80+
}
81+
82+
init {
83+
immediateRenderer("RadiusESP Immediate Renderer") { safeContext ->
84+
if (!beacons) return@immediateRenderer
85+
with(safeContext) {
86+
val chunks = world.chunkManager.chunks.chunks
87+
(0 until chunks.length()).forEach { chunk ->
88+
chunks.get(chunk)?.blockEntities?.values?.forEach { blockEntity ->
89+
val beacon = blockEntity as? BeaconBlockEntity ?: return@forEach
90+
val level = beacon.level
91+
val radius = (level * 10) + 10.0
92+
val box =
93+
Box(blockEntity.pos).expand(radius)
94+
.stretch(0.0, safeContext.world.height.toDouble(), 0.0)
95+
renderBox(box, beaconColor)
96+
}
97+
}
98+
}
99+
}
100+
}
101+
102+
private fun RenderBuilder.renderBox(box: Box, color: Color) =
103+
box(box, worldLineConfig) {
104+
colors(color.setAlpha(fillAlpha), color)
105+
if (!fill) hideFill()
106+
if (!outline) hideOutline()
107+
}
108+
109+
private fun rebuildMesh(ctx: SafeContext, from: Any? = null, to: Any? = null): Unit = chunkedRenderer.rebuild()
110+
}

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

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import com.lambda.module.tag.ModuleTag
3737
import com.lambda.threading.runSafe
3838
import com.lambda.util.EntityUtils.decorationEntityMap
3939
import com.lambda.util.EntityUtils.entityGroup
40+
import com.lambda.util.NamedEnum
4041
import com.lambda.util.extension.blockColor
4142
import com.lambda.util.extension.entityColor
4243
import com.lambda.util.extension.getBlockState
@@ -56,36 +57,43 @@ object Search : Module(
5657
description = "Highlight blocks within the rendered world",
5758
tag = ModuleTag.RENDER,
5859
) {
59-
private val blocks by setting("Blocks", setOf(Blocks.CHEST, Blocks.ENDER_CHEST, Blocks.NETHER_PORTAL, Blocks.END_PORTAL, Blocks.END_PORTAL_FRAME, Blocks.END_GATEWAY), description = "Render blocks")
60+
private enum class Group(override val displayName: String) : NamedEnum {
61+
General("General"),
62+
Fill("Fill"),
63+
Outline("Outline"),
64+
Tracers("Tracers")
65+
}
66+
67+
private val blocks by setting("Blocks", setOf(Blocks.CHEST, Blocks.ENDER_CHEST, Blocks.NETHER_PORTAL, Blocks.END_PORTAL, Blocks.END_PORTAL_FRAME, Blocks.END_GATEWAY), description = "Render blocks").group(Group.General)
6068
.onSelect { rebuildMesh(this) }.onDeselect { rebuildMesh(this) }
61-
private val entities by setting("Entities", decorationEntityMap.values)
69+
private val entities by setting("Entities", decorationEntityMap.values).group(Group.General)
6270
.onSelect { rebuildMesh(this) }.onDeselect { rebuildMesh(this) }
6371

64-
private var fill: Boolean by setting("Fill", true, "Fill the faces of blocks").onValueChange(::rebuildMesh)
72+
private var fill: Boolean by setting("Fill", true, "Fill the faces of blocks").group(Group.Fill).onValueChange(::rebuildMesh)
6573
.onValueChange { _, to -> if (!to) outline = true }
66-
private var outline: Boolean by setting("Outline", true, "Draw the outlines of blocks").onValueChange(::rebuildMesh)
74+
private var outline: Boolean by setting("Outline", true, "Draw the outlines of blocks").group(Group.Outline).onValueChange(::rebuildMesh)
6775
.onValueChange { _, to -> if (!to) fill = true }
68-
private val tracers by setting("Tracers", true, "Draw a line from your cursor to the highlighted position")
69-
private val mesh by setting("Mesh", true, "Connect similar adjacent blocks").onValueChange(::rebuildMesh)
76+
private val mesh by setting("Mesh", true, "Connect similar adjacent blocks").group(Group.General).onValueChange(::rebuildMesh)
7077

71-
private val useNaturalColor by setting("Use Natural Color", true, "Use the color of the block instead").onValueChange(::rebuildMesh)
72-
private val naturalColorAlpha by setting("Natural Color Alpha", 0.3, 0.1..1.0, 0.05) { useNaturalColor }.onValueChange(::rebuildMesh)
73-
private val naturalTracerAlpha by setting("Natural Tracer Alpha", 1.0, 0.1..1.0, 0.05) { useNaturalColor }.onValueChange(::rebuildMesh)
74-
private val minimumNaturalBrightness by setting("Min Brightness", 150, 0..255, 1) { useNaturalColor }.onValueChange(::rebuildMesh)
78+
private val useNaturalColor by setting("Use Natural Color", true, "Use the color of the block instead").group(Group.General).onValueChange(::rebuildMesh)
79+
private val naturalColorAlpha by setting("Natural Color Alpha", 0.3, 0.1..1.0, 0.05) { useNaturalColor }.group(Group.General).onValueChange(::rebuildMesh)
80+
private val naturalTracerAlpha by setting("Natural Tracer Alpha", 1.0, 0.1..1.0, 0.05) { useNaturalColor }.group(Group.General).onValueChange(::rebuildMesh)
81+
private val minimumNaturalBrightness by setting("Min Brightness", 150, 0..255, 1) { useNaturalColor }.group(Group.General).onValueChange(::rebuildMesh)
7582

76-
private val blockFillColor by setting("Block Fill Color", Color(100, 150, 255, 51), "Color of the surfaces") { fill && !useNaturalColor }.onValueChange(::rebuildMesh)
77-
private val blockLineColor by setting("Block Line Color", Color(100, 150, 255, 128)) { outline && !useNaturalColor }.onValueChange(::rebuildMesh)
78-
private val entityFillColor by setting("Entity Fill Color", Color(100, 150, 255, 51)) { fill && !useNaturalColor }.onValueChange(::rebuildMesh)
79-
private val entityOutlineColor by setting("Entity Outline Color", Color(100, 150, 255, 128)) { outline && !useNaturalColor }.onValueChange(::rebuildMesh)
83+
private val blockFillColor by setting("Block Fill Color", Color(100, 150, 255, 51), "Color of the surfaces") { fill && !useNaturalColor }.group(Group.Fill).onValueChange(::rebuildMesh)
84+
private val blockLineColor by setting("Block Line Color", Color(100, 150, 255, 128)) { outline && !useNaturalColor }.group(Group.Outline).onValueChange(::rebuildMesh)
85+
private val entityFillColor by setting("Entity Fill Color", Color(100, 150, 255, 51)) { fill && !useNaturalColor }.group(Group.Fill).onValueChange(::rebuildMesh)
86+
private val entityOutlineColor by setting("Entity Outline Color", Color(100, 150, 255, 128)) { outline && !useNaturalColor }.group(Group.Outline).onValueChange(::rebuildMesh)
8087

81-
private val blockOutlineMode by setting("Block Outline Mode", DirectionMask.OutlineMode.And, "Outline mode") { outline }.onValueChange(::rebuildMesh)
82-
private val outlineConfig = WorldLineSettings(this, prefix = "Outline ") { outline }.apply {
88+
private val blockOutlineMode by setting("Block Outline Mode", DirectionMask.OutlineMode.And, "Outline mode") { outline }.group(Group.Outline, WorldLineSettings.Group.General).onValueChange(::rebuildMesh)
89+
private val outlineConfig = WorldLineSettings(this, Group.Outline, prefix = "Outline ") { outline }.apply {
8390
applyEdits {
8491
hide(::startColor, ::endColor)
8592
settings.forEach { it.onValueChange(::rebuildMesh) }
8693
}
8794
}
88-
private val tracerConfig = ScreenLineSettings(this, prefix = "Tracer ").apply {
95+
private val tracers by setting("Tracers", true, "Draw a line from your cursor to the highlighted position").group(Group.Tracers)
96+
private val tracerConfig = ScreenLineSettings(this, Group.Tracers, prefix = "Tracer ") { tracers }.apply {
8997
applyEdits {
9098
editTyped(::startColor, ::endColor) {
9199
visibility { { !useNaturalColor } }

0 commit comments

Comments
 (0)