Skip to content

Commit 1a667b1

Browse files
author
Nep Nep
authored
Add a configurable StorageESP max range (#377)
* Add configurable StorageESP max range * Remove unnecessary float
1 parent 1e5306d commit 1a667b1

File tree

1 file changed

+5
-0
lines changed
  • src/main/kotlin/com/lambda/client/module/modules/render

1 file changed

+5
-0
lines changed

src/main/kotlin/com/lambda/client/module/modules/render/StorageESP.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.lambda.client.util.color.DyeColors
1010
import com.lambda.client.util.color.HueCycler
1111
import com.lambda.client.util.graphics.ESPRenderer
1212
import com.lambda.client.util.graphics.GeometryMasks
13+
import com.lambda.client.util.math.VectorUtils.distanceTo
1314
import com.lambda.client.util.threads.safeAsyncListener
1415
import kotlinx.coroutines.Dispatchers
1516
import kotlinx.coroutines.coroutineScope
@@ -38,6 +39,8 @@ object StorageESP : Module(
3839
private val dispenser by setting("Dispenser", false, { page == Page.TYPE })
3940
private val hopper by setting("Hopper", false, { page == Page.TYPE })
4041
private val cart by setting("Minecart", false, { page == Page.TYPE })
42+
private val infinite by setting("Infinite Range", true) // To avoid a hard to control range slider
43+
private val range by setting("Range", 64, 8..512, 1, { page == Page.TYPE && !infinite }, unit = " blocks")
4144

4245
/* Color settings */
4346
private val colorChest by setting("Chest Color", DyeColors.ORANGE, { page == Page.COLOR })
@@ -105,6 +108,7 @@ object StorageESP : Module(
105108

106109
private fun SafeClientEvent.updateTileEntities(list: MutableList<Triple<AxisAlignedBB, ColorHolder, Int>>) {
107110
for (tileEntity in world.loadedTileEntityList.toList()) {
111+
if (!infinite && player.distanceTo(tileEntity.pos) > range) continue
108112
if (!checkTileEntityType(tileEntity)) continue
109113

110114
val box = world.getBlockState(tileEntity.pos).getSelectedBoundingBox(world, tileEntity.pos) ?: continue
@@ -150,6 +154,7 @@ object StorageESP : Module(
150154

151155
private fun SafeClientEvent.updateEntities(list: MutableList<Triple<AxisAlignedBB, ColorHolder, Int>>) {
152156
for (entity in world.loadedEntityList.toList()) {
157+
if (!infinite && player.getDistance(entity) > range) continue
153158
if (!checkEntityType(entity)) continue
154159

155160
val box = entity.renderBoundingBox ?: continue

0 commit comments

Comments
 (0)