Skip to content

Commit 2b22f51

Browse files
BaitinqAvanatiker
andauthored
EntitySpeed: Add MaxJump setting (#452)
* EntitySpeed: Add MaxJump setting This patch adds the MaxJump setting to the EntitySpeed module. This works by setting the maximum jump value (90) to the entity if its of type AbstractHorse and the user is pressing down the jump key. * Cleanup Co-authored-by: Constructor <[email protected]>
1 parent 8d12545 commit 2b22f51

File tree

1 file changed

+12
-4
lines changed
  • src/main/kotlin/com/lambda/client/module/modules/movement

1 file changed

+12
-4
lines changed

src/main/kotlin/com/lambda/client/module/modules/movement/EntitySpeed.kt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,29 @@ object EntitySpeed : Module(
1818
private val abstractHorseSpeed by setting("Horse Types Speed", 0.7f, 0.1f..10.0f, 0.05f)
1919
private val pigSpeed by setting("Pig Speed", 1.0f, 0.1f..10.0f, 0.05f)
2020
private val antiStuck by setting("Anti Stuck", true)
21+
private val maxJump by setting("Max Jump", true)
2122

2223
init {
2324
safeListener<PlayerTravelEvent> {
2425
player.ridingEntity?.let { entity ->
2526
var tamper = false
27+
2628
val speed = when {
2729
entity is AbstractHorse && entity.controllingPassenger == player -> abstractHorseSpeed.also { tamper = true }
2830
entity is EntityBoat && entity.controllingPassenger == player -> boatSpeed.also { tamper = true }
2931
entity is EntityPig -> pigSpeed.also { tamper = true }
3032
else -> .0f
3133
}
32-
if (tamper) {
33-
steerEntity(entity, speed, antiStuck)
34-
entity.rotationYaw = player.rotationYaw
35-
}
34+
35+
if (!tamper) return@safeListener
36+
37+
steerEntity(entity, speed, antiStuck)
38+
entity.rotationYaw = player.rotationYaw
39+
40+
if (maxJump
41+
&& entity is AbstractHorse
42+
&& mc.gameSettings.keyBindJump.isKeyDown
43+
) entity.setJumpPower(90)
3644
}
3745
}
3846
}

0 commit comments

Comments
 (0)