Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mode to prevent stepping when player is in a safe hole #295

Merged
merged 4 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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
Expand All @@ -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())
Expand Down Expand Up @@ -97,6 +99,7 @@ object Step : Module(
&& !player.capabilities.isFlying
&& !player.isOnLadder
&& !player.isInOrAboveLiquid
&& (!checkHole || !inHoleCheck())

private fun SafeClientEvent.setStepHeight() {
player.stepHeight = if (upStep.value && player.onGround && player.collidedHorizontally) height else defaultHeight
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,7 +34,7 @@ object SurroundUtils {
break
}

if (block != Blocks.BEDROCK) type = HoleType.OBBY
if (block != Blocks.BEDROCK) type = HoleType.OBSIDIAN
}

return type
Expand All @@ -47,6 +45,6 @@ object SurroundUtils {
}

enum class HoleType {
NONE, OBBY, BEDROCK
NONE, OBSIDIAN, BEDROCK
}
}