From cc10272eab70da07905c7b462a182efef205f30b Mon Sep 17 00:00:00 2001 From: 1zuna Date: Mon, 30 Sep 2024 19:33:35 +0200 Subject: [PATCH] feat: wind charge trajectory fixes https://github.com/CCBlueX/LiquidBounce/issues/3929 --- .../render/trajectories/ModuleTrajectories.kt | 12 +++++++----- .../modules/render/trajectories/TrajectoryData.kt | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/ModuleTrajectories.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/ModuleTrajectories.kt index b8afaa28281..aa1e3937729 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/ModuleTrajectories.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/ModuleTrajectories.kt @@ -115,11 +115,13 @@ object ModuleTrajectories : Module("Trajectories", Category.RENDER) { cos(yawRadians) * cos(pitchRadians).toDouble() ).normalize() * trajectoryInfo.initialVelocity - velocity += Vec3d( - otherPlayer.velocity.x, - if (otherPlayer.isOnGround) 0.0 else otherPlayer.velocity.y, - otherPlayer.velocity.z - ) + if (trajectoryInfo.copiesPlayerVelocity) { + velocity += Vec3d( + otherPlayer.velocity.x, + if (otherPlayer.isOnGround) 0.0 else otherPlayer.velocity.y, + otherPlayer.velocity.z + ) + } val renderer = TrajectoryInfoRenderer( owner = otherPlayer, diff --git a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/TrajectoryData.kt b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/TrajectoryData.kt index 8cc4f98f9ff..5570289105b 100644 --- a/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/TrajectoryData.kt +++ b/src/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/trajectories/TrajectoryData.kt @@ -32,6 +32,7 @@ object TrajectoryData { is EggItem -> TrajectoryInfo.GENERIC is ExperienceBottleItem -> TrajectoryInfo.EXP_BOTTLE is FireChargeItem -> TrajectoryInfo.FIREBALL + is WindChargeItem -> TrajectoryInfo.WIND_CHARGE else -> null } } @@ -102,7 +103,8 @@ data class TrajectoryInfo( val initialVelocity: Double = 1.5, val drag: Double = 0.99, val dragInWater: Double = 0.6, - val roll: Float = 0.0F + val roll: Float = 0.0F, + val copiesPlayerVelocity: Boolean = true, ) { companion object { val GENERIC = TrajectoryInfo(0.03, 0.25) @@ -113,5 +115,6 @@ data class TrajectoryInfo( val TRIDENT = PERSISTENT.copy(initialVelocity = 2.5, gravity = 0.05, dragInWater = 0.99) val BOW_FULL_PULL = PERSISTENT.copy(initialVelocity = 3.0) val FIREBALL = TrajectoryInfo(gravity = 0.0, hitboxRadius = 1.0) + val WIND_CHARGE = TrajectoryInfo(gravity = 0.0, hitboxRadius = 1.0, copiesPlayerVelocity = false) } }