-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
progreso-client/src/main/kotlin/org/progreso/client/modules/render/ESP.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package org.progreso.client.modules.render | ||
|
||
import net.minecraft.entity.Entity | ||
import net.minecraft.entity.mob.Monster | ||
import net.minecraft.entity.mob.WaterCreatureEntity | ||
import net.minecraft.entity.passive.IronGolemEntity | ||
import net.minecraft.entity.passive.PassiveEntity | ||
import net.minecraft.entity.passive.SnowGolemEntity | ||
import net.minecraft.entity.player.PlayerEntity | ||
import net.minecraft.util.math.MathHelper | ||
import net.minecraft.util.math.Vec3d | ||
import org.progreso.api.module.AbstractModule | ||
import org.progreso.client.Client.Companion.mc | ||
import org.progreso.client.events.misc.TickEvent | ||
import org.progreso.client.events.render.Render3DEvent | ||
import org.progreso.client.events.safeEventListener | ||
import org.progreso.client.gui.clickgui.element.elements.ColorElement.Companion.copy | ||
import org.progreso.client.util.render.* | ||
import java.awt.Color | ||
|
||
@AbstractModule.AutoRegister | ||
object ESP : AbstractModule() { | ||
private val players by setting("Players", true) | ||
private val monsters by setting("Monsters", false) | ||
private val animals by setting("Animals", false) | ||
private val self by setting("Self", false) | ||
|
||
private val colors = setting("colors") | ||
private val playersColor by colors.setting("Players", Color.WHITE) | ||
private val monstersColor by colors.setting("Monsters", Color.RED) | ||
private val animalsColor by setting("Animals", Color.GREEN) | ||
|
||
private val renderMap = mutableMapOf<Entity, Color>() | ||
|
||
init { | ||
safeEventListener<TickEvent> { | ||
renderMap.clear() | ||
|
||
for (entity in mc.world.entities) { | ||
if (entity == mc.player && !self) continue | ||
|
||
val (render, color) = when (entity) { | ||
is PlayerEntity -> players to playersColor | ||
is Monster -> monsters to monstersColor | ||
is PassiveEntity, is WaterCreatureEntity, is SnowGolemEntity, is IronGolemEntity -> animals to animalsColor | ||
else -> continue | ||
} | ||
|
||
if (render) renderMap[entity] = color | ||
} | ||
} | ||
|
||
safeEventListener<Render3DEvent> { event -> | ||
for ((entity, color) in renderMap) { | ||
val pos = Vec3d( | ||
MathHelper.lerp(event.tickDelta.toDouble(), entity.lastRenderX, entity.x) - entity.x, | ||
MathHelper.lerp(event.tickDelta.toDouble(), entity.lastRenderY, entity.y) - entity.y, | ||
MathHelper.lerp(event.tickDelta.toDouble(), entity.lastRenderZ, entity.z) - entity.z | ||
) | ||
|
||
render3D(event.matrices) { | ||
withPosition(pos) { | ||
withColor(color.copy(50)) { | ||
drawSolidBox(entity.boundingBox) | ||
} | ||
|
||
withColor(color.copy(100)) { | ||
drawOutlinedBox(entity.boundingBox) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters