From 0cd31ad105f837256c574d74951eaeb73ac9df3b Mon Sep 17 00:00:00 2001 From: SnivyLlama <61280616+SnivyLlama@users.noreply.github.com> Date: Mon, 11 Apr 2022 19:18:40 -0500 Subject: [PATCH 1/4] Check hole option for Step module. This option allows you to prevent Step from moving you out of a hole! --- .../kotlin/com/lambda/client/module/modules/movement/Step.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt index ccca34a34..9d6eafa3f 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt @@ -10,6 +10,7 @@ import com.lambda.client.setting.settings.impl.primitive.BooleanSetting import com.lambda.client.util.BaritoneUtils import com.lambda.client.util.Bind import com.lambda.client.util.EntityUtils.isInOrAboveLiquid +import com.lambda.client.util.combat.SurroundUtils import com.lambda.client.util.text.MessageSendHelper import com.lambda.client.util.threads.runSafe import com.lambda.client.util.threads.safeListener @@ -33,6 +34,7 @@ object Step : Module( private val upStep = setting("Up Step", true) private val downStep = setting("Down Step", false) private val entityStep by setting("Entities", true) + private val checkHole by setting("Check Hole", false) private val height by setting("Height", 1.0f, 0.25f..2.0f, 0.25f) private val downSpeed by setting("Down Speed", 0.2f, 0.0f..1.0f, 0.05f) private val bindUpStep by setting("Bind Up Step", Bind()) @@ -97,6 +99,7 @@ object Step : Module( && !player.capabilities.isFlying && !player.isOnLadder && !player.isInOrAboveLiquid + && (!checkHole.value || SurrondUtils.checkHole(player) == SurroundUtils.HoleType.NONE) private fun SafeClientEvent.setStepHeight() { player.stepHeight = if (upStep.value && player.onGround && player.collidedHorizontally) height else defaultHeight @@ -144,4 +147,4 @@ object Step : Module( BaritoneUtils.settings?.assumeStep?.value = isEnabled && it } } -} \ No newline at end of file +} From 85d4e211810c2a873f69b205ab066b2621e4d1ef Mon Sep 17 00:00:00 2001 From: SnivyLlama <61280616+SnivyLlama@users.noreply.github.com> Date: Wed, 13 Apr 2022 18:46:54 -0500 Subject: [PATCH 2/4] Fix typo --- .../kotlin/com/lambda/client/module/modules/movement/Step.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt index 9d6eafa3f..eb1ff1d43 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt @@ -99,7 +99,7 @@ object Step : Module( && !player.capabilities.isFlying && !player.isOnLadder && !player.isInOrAboveLiquid - && (!checkHole.value || SurrondUtils.checkHole(player) == SurroundUtils.HoleType.NONE) + && (!checkHole.value || SurroundUtils.checkHole(player) == SurroundUtils.HoleType.NONE) private fun SafeClientEvent.setStepHeight() { player.stepHeight = if (upStep.value && player.onGround && player.collidedHorizontally) height else defaultHeight From ead2e85599519a1495bf02e9bcf6126854e2e1a0 Mon Sep 17 00:00:00 2001 From: Constructor Date: Thu, 14 Apr 2022 05:07:53 +0200 Subject: [PATCH 3/4] Refactor and proper hole check --- .../com/lambda/client/module/modules/combat/HoleESP.kt | 2 +- .../com/lambda/client/module/modules/combat/HoleMiner.kt | 2 +- .../com/lambda/client/module/modules/combat/Surround.kt | 2 +- .../com/lambda/client/module/modules/movement/Step.kt | 4 ++-- .../kotlin/com/lambda/client/util/combat/SurroundUtils.kt | 6 ++---- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/combat/HoleESP.kt b/src/main/kotlin/com/lambda/client/module/modules/combat/HoleESP.kt index 8812157de..e9c5d8574 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/combat/HoleESP.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/combat/HoleESP.kt @@ -72,7 +72,7 @@ object HoleESP : Module( val bb = AxisAlignedBB(if (renderMode == Mode.BLOCK_FLOOR) pos.down() else pos) - if (holeType == SurroundUtils.HoleType.OBBY && shouldAddObsidian()) { + if (holeType == SurroundUtils.HoleType.OBSIDIAN && shouldAddObsidian()) { cached.add(Triple(bb, colorObsidian, side)) } diff --git a/src/main/kotlin/com/lambda/client/module/modules/combat/HoleMiner.kt b/src/main/kotlin/com/lambda/client/module/modules/combat/HoleMiner.kt index a2f27ea79..1419c7bbe 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/combat/HoleMiner.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/combat/HoleMiner.kt @@ -49,7 +49,7 @@ object HoleMiner : Module( runSafeR { val target = CombatManager.target if (target != null) { - if (checkHole(target) != SurroundUtils.HoleType.OBBY) { + if (checkHole(target) != SurroundUtils.HoleType.OBSIDIAN) { MessageSendHelper.sendChatMessage("$chatName Target is not in a valid hole, disabling") disable() } else { diff --git a/src/main/kotlin/com/lambda/client/module/modules/combat/Surround.kt b/src/main/kotlin/com/lambda/client/module/modules/combat/Surround.kt index c96f31ae7..158e583ef 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/combat/Surround.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/combat/Surround.kt @@ -130,7 +130,7 @@ object Surround : Module( } } - private fun SafeClientEvent.inHoleCheck() = player.onGround && player.speed < 0.15 && checkHole(player) == SurroundUtils.HoleType.OBBY + fun SafeClientEvent.inHoleCheck() = player.onGround && player.speed < 0.15 && checkHole(player) == SurroundUtils.HoleType.OBSIDIAN private fun outOfHoleCheck() { if (autoDisable == AutoDisableMode.OUT_OF_HOLE) { diff --git a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt index eb1ff1d43..07f565c10 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt @@ -10,11 +10,11 @@ import com.lambda.client.setting.settings.impl.primitive.BooleanSetting import com.lambda.client.util.BaritoneUtils import com.lambda.client.util.Bind import com.lambda.client.util.EntityUtils.isInOrAboveLiquid -import com.lambda.client.util.combat.SurroundUtils import com.lambda.client.util.text.MessageSendHelper import com.lambda.client.util.threads.runSafe import com.lambda.client.util.threads.safeListener import com.lambda.client.event.listener.listener +import com.lambda.client.module.modules.combat.Surround.inHoleCheck import net.minecraft.network.play.client.CPacketPlayer import net.minecraftforge.fml.common.gameevent.InputEvent import net.minecraftforge.fml.common.gameevent.TickEvent @@ -99,7 +99,7 @@ object Step : Module( && !player.capabilities.isFlying && !player.isOnLadder && !player.isInOrAboveLiquid - && (!checkHole.value || SurroundUtils.checkHole(player) == SurroundUtils.HoleType.NONE) + && (!checkHole || !inHoleCheck()) private fun SafeClientEvent.setStepHeight() { player.stepHeight = if (upStep.value && player.onGround && player.collidedHorizontally) height else defaultHeight diff --git a/src/main/kotlin/com/lambda/client/util/combat/SurroundUtils.kt b/src/main/kotlin/com/lambda/client/util/combat/SurroundUtils.kt index cde850698..91231e578 100644 --- a/src/main/kotlin/com/lambda/client/util/combat/SurroundUtils.kt +++ b/src/main/kotlin/com/lambda/client/util/combat/SurroundUtils.kt @@ -9,8 +9,6 @@ import net.minecraft.init.Blocks import net.minecraft.util.math.BlockPos object SurroundUtils { - private val mc = Wrapper.minecraft - val surroundOffset = arrayOf( BlockPos(0, -1, 0), // down BlockPos(0, 0, -1), // north @@ -36,7 +34,7 @@ object SurroundUtils { break } - if (block != Blocks.BEDROCK) type = HoleType.OBBY + if (block != Blocks.BEDROCK) type = HoleType.OBSIDIAN } return type @@ -47,6 +45,6 @@ object SurroundUtils { } enum class HoleType { - NONE, OBBY, BEDROCK + NONE, OBSIDIAN, BEDROCK } } \ No newline at end of file From e054173e1246dbffefd81ae7e8694ec0cb9fb01a Mon Sep 17 00:00:00 2001 From: Constructor Date: Thu, 14 Apr 2022 05:09:29 +0200 Subject: [PATCH 4/4] Remove trailing line --- .../kotlin/com/lambda/client/module/modules/movement/Step.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt index 07f565c10..3857445e8 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/movement/Step.kt @@ -147,4 +147,4 @@ object Step : Module( BaritoneUtils.settings?.assumeStep?.value = isEnabled && it } } -} +} \ No newline at end of file