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

Commit

Permalink
ElytraFlightNew sprint fast speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna5ama committed Sep 14, 2023
1 parent dced9d4 commit f9fb28e
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ internal object ElytraFlightNew : Module(
private val fallTimer by setting("Fall Timer", 0.25f, 0.1f..2.0f, 0.01f)
private val boostTimer by setting("Boost Timer", 1.08f, 1.0f..2.0f, 0.01f)
private val minTakeoffHeight by setting("Min Takeoff Height", 0.8f, 0.0f..1.5f, 0.1f)
private val speed by setting("Speed", 2.5f, 0.1f..10.0f, 0.05f)
private val upSpeed by setting("Up Speed", 2.5f, 0.1f..10.0f, 0.05f)
private val downSpeed by setting("Down Speed", 2.5f, 0.1f..10.0f, 0.05f)
private val speed by setting("Speed", 1.5f, 0.1f..10.0f, 0.05f)
private val speedFast by setting("Speed Fast", 2.5f, 0.1f..10.0f, 0.05f)
private val upSpeed by setting("Up Speed", 1.5f, 0.1f..10.0f, 0.05f)
private val upSpeedFast by setting("Up Speed Fast", 2.5f, 0.1f..10.0f, 0.05f)
private val downSpeed by setting("Down Speed", 1.5f, 0.1f..10.0f, 0.05f)
private val downSpeedFast by setting("Down Speed Fast", 2.5f, 0.1f..10.0f, 0.05f)

private var state = State.ON_GROUND

Expand Down Expand Up @@ -82,8 +85,11 @@ internal object ElytraFlightNew : Module(
private fun SafeClientEvent.fly(event: PlayerMoveEvent.Pre) {
player.motionY = 0.0

val sprint = mc.gameSettings.keyBindSprint.isKeyDown

if (MovementUtils.isInputting()) {
val yaw = player.calcMoveYaw()
val speed = if (sprint) speedFast else speed
event.x = -sin(yaw) * speed
event.z = cos(yaw) * speed
modifyTimer(50.0f / boostTimer)
Expand All @@ -98,9 +104,9 @@ internal object ElytraFlightNew : Module(

if (jump xor sneak) {
if (jump) {
event.y = upSpeed.toDouble()
event.y = (if (sprint) upSpeedFast else upSpeed).toDouble()
} else {
event.y = -downSpeed.toDouble()
event.y = -(if (sprint) downSpeedFast else downSpeed).toDouble()
}
}

Expand Down

0 comments on commit f9fb28e

Please sign in to comment.