Skip to content

Commit ebbe98a

Browse files
Added mode to prevent stepping when player is in a safe hole (#295)
* Check hole option for Step module. This option allows you to prevent Step from moving you out of a hole! * Fix typo * Refactor and proper hole check * Remove trailing line Co-authored-by: Constructor <[email protected]>
1 parent d2f21cd commit ebbe98a

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/main/kotlin/com/lambda/client/module/modules/combat/HoleESP.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ object HoleESP : Module(
7272

7373
val bb = AxisAlignedBB(if (renderMode == Mode.BLOCK_FLOOR) pos.down() else pos)
7474

75-
if (holeType == SurroundUtils.HoleType.OBBY && shouldAddObsidian()) {
75+
if (holeType == SurroundUtils.HoleType.OBSIDIAN && shouldAddObsidian()) {
7676
cached.add(Triple(bb, colorObsidian, side))
7777
}
7878

src/main/kotlin/com/lambda/client/module/modules/combat/HoleMiner.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ object HoleMiner : Module(
4949
runSafeR {
5050
val target = CombatManager.target
5151
if (target != null) {
52-
if (checkHole(target) != SurroundUtils.HoleType.OBBY) {
52+
if (checkHole(target) != SurroundUtils.HoleType.OBSIDIAN) {
5353
MessageSendHelper.sendChatMessage("$chatName Target is not in a valid hole, disabling")
5454
disable()
5555
} else {

src/main/kotlin/com/lambda/client/module/modules/combat/Surround.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ object Surround : Module(
130130
}
131131
}
132132

133-
private fun SafeClientEvent.inHoleCheck() = player.onGround && player.speed < 0.15 && checkHole(player) == SurroundUtils.HoleType.OBBY
133+
fun SafeClientEvent.inHoleCheck() = player.onGround && player.speed < 0.15 && checkHole(player) == SurroundUtils.HoleType.OBSIDIAN
134134

135135
private fun outOfHoleCheck() {
136136
if (autoDisable == AutoDisableMode.OUT_OF_HOLE) {

src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import com.lambda.client.util.text.MessageSendHelper
1414
import com.lambda.client.util.threads.runSafe
1515
import com.lambda.client.util.threads.safeListener
1616
import com.lambda.client.event.listener.listener
17+
import com.lambda.client.module.modules.combat.Surround.inHoleCheck
1718
import net.minecraft.network.play.client.CPacketPlayer
1819
import net.minecraftforge.fml.common.gameevent.InputEvent
1920
import net.minecraftforge.fml.common.gameevent.TickEvent
@@ -33,6 +34,7 @@ object Step : Module(
3334
private val upStep = setting("Up Step", true)
3435
private val downStep = setting("Down Step", false)
3536
private val entityStep by setting("Entities", true)
37+
private val checkHole by setting("Check Hole", false)
3638
private val height by setting("Height", 1.0f, 0.25f..2.0f, 0.25f)
3739
private val downSpeed by setting("Down Speed", 0.2f, 0.0f..1.0f, 0.05f)
3840
private val bindUpStep by setting("Bind Up Step", Bind())
@@ -97,6 +99,7 @@ object Step : Module(
9799
&& !player.capabilities.isFlying
98100
&& !player.isOnLadder
99101
&& !player.isInOrAboveLiquid
102+
&& (!checkHole || !inHoleCheck())
100103

101104
private fun SafeClientEvent.setStepHeight() {
102105
player.stepHeight = if (upStep.value && player.onGround && player.collidedHorizontally) height else defaultHeight

src/main/kotlin/com/lambda/client/util/combat/SurroundUtils.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import net.minecraft.init.Blocks
99
import net.minecraft.util.math.BlockPos
1010

1111
object SurroundUtils {
12-
private val mc = Wrapper.minecraft
13-
1412
val surroundOffset = arrayOf(
1513
BlockPos(0, -1, 0), // down
1614
BlockPos(0, 0, -1), // north
@@ -36,7 +34,7 @@ object SurroundUtils {
3634
break
3735
}
3836

39-
if (block != Blocks.BEDROCK) type = HoleType.OBBY
37+
if (block != Blocks.BEDROCK) type = HoleType.OBSIDIAN
4038
}
4139

4240
return type
@@ -47,6 +45,6 @@ object SurroundUtils {
4745
}
4846

4947
enum class HoleType {
50-
NONE, OBBY, BEDROCK
48+
NONE, OBSIDIAN, BEDROCK
5149
}
5250
}

0 commit comments

Comments
 (0)