@@ -16,32 +16,26 @@ object EntitySpeed : Module(
1616 category = Category .MOVEMENT ,
1717 description = " Abuse client-sided movement to shape sound barrier breaking rideables"
1818) {
19- private val speed by setting(" Speed" , 1.0f , 0.1f .. 25.0f , 0.1f )
19+ private val boatSpeed by setting(" Boat Speed" , 1.4f , 0.1f .. 10.0f , 0.05f )
20+ private val abstractHorseSpeed by setting(" Horse Types Speed" , 0.7f , 0.1f .. 10.0f , 0.05f )
21+ private val pigSpeed by setting(" Pig Speed" , 1.0f , 0.1f .. 10.0f , 0.05f )
2022 private val antiStuck by setting(" Anti Stuck" , true )
21- private val flight by setting(" Flight" , false )
22- private val glideSpeed by setting(" Glide Speed" , 0.1f , 0.0f .. 1.0f , 0.01f , { flight })
23- private val upSpeed by setting(" Up Speed" , 1.0f , 0.0f .. 5.0f , 0.1f , { flight })
2423
2524 init {
2625 safeListener<PlayerTravelEvent > {
2726 player.ridingEntity?.let { entity ->
28- if (entity is EntityPig
29- || entity is AbstractHorse && entity.controllingPassenger == player
30- || entity is EntityBoat && entity.controllingPassenger == player) {
27+ var tamper = false
28+ val speed = when {
29+ entity is AbstractHorse && entity.controllingPassenger == player -> abstractHorseSpeed.also { tamper = true }
30+ entity is EntityBoat && entity.controllingPassenger == player -> boatSpeed.also { tamper = true }
31+ entity is EntityPig -> pigSpeed.also { tamper = true }
32+ else -> .0f
33+ }
34+ if (tamper) {
3135 steerEntity(entity, speed, antiStuck)
32-
33- if (entity is EntityHorse ) {
34- entity.rotationYaw = player.rotationYaw
35- }
36-
37- if (flight) fly(entity)
36+ entity.rotationYaw = player.rotationYaw
3837 }
3938 }
4039 }
4140 }
42-
43- private fun fly (entity : Entity ) {
44- if (! entity.isInWater) entity.motionY = - glideSpeed.toDouble()
45- if (mc.gameSettings.keyBindJump.isKeyDown) entity.motionY + = upSpeed / 2.0
46- }
4741}
0 commit comments