Skip to content

Commit

Permalink
fix(SpeedVulcanGround286): not able to jump
Browse files Browse the repository at this point in the history
fixes #4768
  • Loading branch information
1zun4 committed Dec 15, 2024
1 parent a421137 commit 49637e6
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SpeedVulcanGround286(override val parent: ChoiceConfigurable<*>) : SpeedBH

@Suppress("unused")
private val afterJumpHandler = tickHandler {
if (player.moving && collidesBottomVertical()) {
if (player.moving && collidesBottomVertical() && !mc.options.jumpKey.isPressed) {
val speedEffect = player.getStatusEffect(StatusEffects.SPEED)
val isAffectedBySpeed = speedEffect != null && speedEffect.amplifier > 0
val isMovingSideways = player.input.movementSideways != 0f
Expand All @@ -57,8 +57,9 @@ class SpeedVulcanGround286(override val parent: ChoiceConfigurable<*>) : SpeedBH
}
}

val packetHandler = handler<PacketEvent> { event ->
if (event.packet is PlayerMoveC2SPacket && collidesBottomVertical()) {
@Suppress("unused")
private val packetHandler = handler<PacketEvent> { event ->
if (event.packet is PlayerMoveC2SPacket && collidesBottomVertical() && !mc.options.jumpKey.isPressed) {
event.packet.y += 0.005
}
}
Expand All @@ -68,8 +69,12 @@ class SpeedVulcanGround286(override val parent: ChoiceConfigurable<*>) : SpeedBH
shape != VoxelShapes.empty()
}

val jumpEvent = handler<PlayerJumpEvent> { event ->
event.cancelEvent()
@Suppress("unused")
private val jumpEvent = handler<PlayerJumpEvent> { event ->
if (!mc.options.jumpKey.isPressed) {
event.cancelEvent()
}
}

}

0 comments on commit 49637e6

Please sign in to comment.