Skip to content

Commit

Permalink
feat(legacy): scaffold eagle mode (onground, onair, both) (#5011)
Browse files Browse the repository at this point in the history
  • Loading branch information
EclipsesDev authored Dec 22, 2024
1 parent 9e058a5 commit ae5293e
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,15 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule
private val eagleValue =
ListValue("Eagle", arrayOf("Normal", "Silent", "Off"), "Normal") { scaffoldMode != "GodBridge" }
val eagle by eagleValue
private val eagleMode by choices("EagleMode", arrayOf("Both", "OnGround", "OnAir"), "Both")
{ eagleValue.isSupported() && eagle != "Off" }
private val adjustedSneakSpeed by boolean("AdjustedSneakSpeed", true) { eagle == "Silent" }
private val eagleSpeed by float("EagleSpeed", 0.3f, 0.3f..1.0f) { eagleValue.isSupported() && eagle != "Off" }
val eagleSprint by boolean("EagleSprint", false) { eagleValue.isSupported() && eagle == "Normal" }
private val blocksToEagle by int("BlocksToEagle", 0, 0..10) { eagleValue.isSupported() && eagle != "Off" }
private val edgeDistance by float(
"EagleEdgeDistance", 0f, 0f..0.5f
) { eagleValue.isSupported() && eagle != "Off" }
private val onlyOnGround by boolean("OnlyOnGround", false) { eagleValue.isSupported() && eagle != "Off" }

// Rotation Options
private val modeList =
Expand Down Expand Up @@ -315,7 +316,7 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule
private var placedBlocksWithoutEagle = 0
var eagleSneaking = false
private val isEagleEnabled
get() = eagle != "Off" && !shouldGoDown && scaffoldMode != "GodBridge" && (!onlyOnGround || mc.thePlayer?.onGround == true)
get() = eagle != "Off" && !shouldGoDown && scaffoldMode != "GodBridge"

// Downwards
val shouldGoDown
Expand Down Expand Up @@ -432,7 +433,14 @@ object Scaffold : Module("Scaffold", Category.WORLD, Keyboard.KEY_I, hideModule
}

if (placedBlocksWithoutEagle >= blocksToEagle) {
val shouldEagle = blockPos.isReplaceable || dif < edgeDistance
val eagleCondition = when (eagleMode) {
"OnGround" -> player.onGround
"OnAir" -> !player.onGround
else -> true
}

val shouldEagle = eagleCondition && (blockPos.isReplaceable || dif < edgeDistance)

if (eagle == "Silent") {
if (eagleSneaking != shouldEagle) {
sendPacket(
Expand Down

0 comments on commit ae5293e

Please sign in to comment.