Skip to content
This repository has been archived by the owner on Apr 22, 2021. It is now read-only.

Commit

Permalink
[enhancement] Threaded HoleESP, VoidESP, StorageESP, StashLogger, Sea…
Browse files Browse the repository at this point in the history
…rch (#1816)
  • Loading branch information
Luna5ama authored Jan 7, 2021
1 parent b4467fa commit 385fb16
Show file tree
Hide file tree
Showing 11 changed files with 476 additions and 429 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object SearchCommand : ClientCommand(

literal("override") {
execute("Override the Intel Integrated GPU check") {
Search.overrideWarning.value = true
Search.overrideWarning = true
MessageSendHelper.sendWarningMessage("Override for Intel Integrated GPUs enabled!")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import me.zeroeightsix.kami.util.graphics.font.FontRenderAdapter
import me.zeroeightsix.kami.util.graphics.font.HAlign
import me.zeroeightsix.kami.util.graphics.font.TextComponent
import me.zeroeightsix.kami.util.graphics.font.VAlign
import me.zeroeightsix.kami.util.threads.safeAsyncListener
import me.zeroeightsix.kami.util.threads.safeListener
import net.minecraft.client.renderer.GlStateManager
import net.minecraftforge.fml.common.gameevent.TickEvent
import org.kamiblue.commons.extension.sumByFloat
Expand Down Expand Up @@ -67,8 +67,8 @@ object ModuleList : HudElement(
.toMutableMap()

init {
safeAsyncListener<TickEvent.ClientTickEvent> { event ->
if (event.phase != TickEvent.Phase.END) return@safeAsyncListener
safeListener<TickEvent.ClientTickEvent> { event ->
if (event.phase != TickEvent.Phase.END) return@safeListener

val moduleSet = ModuleManager.modules.toSet()

Expand Down
51 changes: 32 additions & 19 deletions src/main/java/me/zeroeightsix/kami/module/modules/combat/HoleESP.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
package me.zeroeightsix.kami.module.modules.combat

import kotlinx.coroutines.launch
import me.zeroeightsix.kami.event.SafeClientEvent
import me.zeroeightsix.kami.event.events.RenderWorldEvent
import me.zeroeightsix.kami.module.Module
import me.zeroeightsix.kami.setting.ModuleConfig.setting
import me.zeroeightsix.kami.util.TickTimer
import me.zeroeightsix.kami.util.color.ColorHolder
import me.zeroeightsix.kami.util.combat.SurroundUtils
import me.zeroeightsix.kami.util.combat.SurroundUtils.checkHole
import me.zeroeightsix.kami.util.graphics.ESPRenderer
import me.zeroeightsix.kami.util.graphics.GeometryMasks
import me.zeroeightsix.kami.util.math.VectorUtils.toBlockPos
import org.kamiblue.event.listener.listener
import me.zeroeightsix.kami.util.threads.defaultScope
import me.zeroeightsix.kami.util.threads.safeListener
import net.minecraft.util.math.AxisAlignedBB

object HoleESP : Module(
name = "HoleESP",
category = Category.COMBAT,
description = "Show safe holes for crystal pvp"
) {
private val range = setting("RenderDistance", 8, 4..16, 1)
private val range = setting("RenderDistance", 8, 4..32, 1)
private val filled = setting("Filled", true)
private val outline = setting("Outline", true)
private val hideOwn = setting("HideOwn", true)
Expand All @@ -43,38 +48,46 @@ object HoleESP : Module(
private val timer = TickTimer()

init {
listener<RenderWorldEvent> {
if (mc.world == null || mc.player == null) return@listener
if (timer.tick(133L)) updateRenderer() // Avoid running this on a tick
safeListener<RenderWorldEvent> {
if (timer.tick(133L)) { // Avoid running this on a tick
updateRenderer()
}
renderer.render(false)
}
}

private fun updateRenderer() {
renderer.clear()
private fun SafeClientEvent.updateRenderer() {
renderer.aFilled = if (filled.value) aFilled.value else 0
renderer.aOutline = if (outline.value) aOutline.value else 0

val colorObsidian = ColorHolder(r1.value, g1.value, b1.value)
val colorBedrock = ColorHolder(r2.value, g2.value, b2.value)
val playerPos = mc.player.positionVector.toBlockPos()
val playerPos = player.positionVector.toBlockPos()
val side = if (renderMode.value != Mode.FLAT) GeometryMasks.Quad.ALL
else GeometryMasks.Quad.DOWN

for (x in -range.value..range.value) for (y in -range.value..range.value) for (z in -range.value..range.value) {
if (hideOwn.value && x == 0 && y == 0 && z == 0) continue
val pos = playerPos.add(x, y, z)
val holeType = SurroundUtils.checkHole(pos)
if (holeType == SurroundUtils.HoleType.NONE) continue
val renderPos = if (renderMode.value == Mode.BLOCK_FLOOR) pos.down() else pos
defaultScope.launch {
val cached = ArrayList<Triple<AxisAlignedBB, ColorHolder, Int>>()

if (holeType == SurroundUtils.HoleType.OBBY && shouldAddObsidian()) {
renderer.add(renderPos, colorObsidian, side)
}
for (x in -range.value..range.value) for (y in -range.value..range.value) for (z in -range.value..range.value) {
if (hideOwn.value && x == 0 && y == 0 && z == 0) continue
val pos = playerPos.add(x, y, z)

val holeType = checkHole(pos)
if (holeType == SurroundUtils.HoleType.NONE) continue

if (holeType == SurroundUtils.HoleType.BEDROCK && shouldAddBedrock()) {
renderer.add(renderPos, colorBedrock, side)
val bb = AxisAlignedBB(if (renderMode.value == Mode.BLOCK_FLOOR) pos.down() else pos)

if (holeType == SurroundUtils.HoleType.OBBY && shouldAddObsidian()) {
cached.add(Triple(bb, colorObsidian, side))
}

if (holeType == SurroundUtils.HoleType.BEDROCK && shouldAddBedrock()) {
cached.add(Triple(bb, colorBedrock, side))
}
}

renderer.replaceAll(cached)
}
}

Expand Down
122 changes: 0 additions & 122 deletions src/main/java/me/zeroeightsix/kami/module/modules/misc/StashFinder.kt

This file was deleted.

Loading

0 comments on commit 385fb16

Please sign in to comment.