Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Commit

Permalink
Legit FastStairs
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInMyVan committed Aug 6, 2024
1 parent 2162aa7 commit 5bbed1a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,45 @@ import net.ccbluex.liquidbounce.event.events.UpdateEvent
import net.ccbluex.liquidbounce.features.module.Module
import net.ccbluex.liquidbounce.features.module.ModuleCategory.MOVEMENT
import net.ccbluex.liquidbounce.utils.MovementUtils.isMoving
import net.ccbluex.liquidbounce.utils.SimulatedPlayer
import net.ccbluex.liquidbounce.utils.block.BlockUtils.getBlock
import net.ccbluex.liquidbounce.utils.extensions.jmp
import net.ccbluex.liquidbounce.utils.extensions.update
import net.ccbluex.liquidbounce.value.BooleanValue
import net.ccbluex.liquidbounce.value.ListValue
import net.minecraft.block.BlockStairs
import net.minecraft.util.BlockPos

object FastStairs : Module("FastStairs", MOVEMENT) {

private val mode by ListValue(
"Mode",
arrayOf("Step", "NCP", "AAC3.1.0", "AAC3.3.6", "AAC3.3.13").sortedArray(),
"NCP"
arrayOf("Step", "NCP", "AAC3.1.0", "AAC3.3.6", "AAC3.3.13", "Legit").sortedArray(),
"Legit"
)
private val longJump by BooleanValue("LongJump", false) { mode.startsWith("AAC") }

private var canJump = false

private var jumped = false
private var walkingDown = false

@EventTarget
fun onUpdate(event: UpdateEvent) {
if (jumped) {
mc.gameSettings.keyBindJump.update()
}

if (mode == "Legit") {
val simulatedPlayer = SimulatedPlayer.fromClientPlayer(mc.thePlayer.movementInput)

simulatedPlayer.stepConfirm = {
mc.gameSettings.keyBindJump.pressed = true
jumped = true
}

simulatedPlayer.tick()
return
}

val thePlayer = mc.thePlayer ?: return

if (!isMoving || Speed.handleEvents())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ class SimulatedPlayer(
val pos: Vec3
get() = Vec3(posX, posY, posZ)

var stepConfirm: () -> Unit = {}

private var moveForward = 0f
private var moveStrafing = 0f
private var isJumping = false
Expand Down Expand Up @@ -732,6 +734,8 @@ class SimulatedPlayer(
velocityY = d7
velocityZ = d8
this.setEntityBoundingBox(axisalignedbb3)
} else {
stepConfirm()
}
}
resetPositionToBB()
Expand Down

0 comments on commit 5bbed1a

Please sign in to comment.