1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-01-18 23:23:19 +01:00

Add back known movement check

This commit is contained in:
Nassim Jahnke 2025-01-12 15:29:07 +01:00
parent 08ac057fda
commit 9746d73ade
No known key found for this signature in database
GPG key ID: EF6771C01F6EF02F

View file

@ -54,11 +54,14 @@
}
this.leftOwner = compound.getBoolean("LeftOwner");
@@ -175,13 +_,22 @@
@@ -175,13 +_,25 @@
float f2 = Mth.cos(y * (float) (Math.PI / 180.0)) * Mth.cos(x * (float) (Math.PI / 180.0));
this.shoot(f, f1, f2, velocity, inaccuracy);
Vec3 knownMovement = shooter.getKnownMovement();
+ // Paper start - allow disabling relative velocity
+ if (Double.isNaN(knownMovement.x) || Double.isNaN(knownMovement.y) || Double.isNaN(knownMovement.z)) {
+ knownMovement = new Vec3(0, 0, 0);
+ }
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) {
this.setDeltaMovement(this.getDeltaMovement().add(knownMovement.x, shooter.onGround() ? 0.0 : knownMovement.y, knownMovement.z));
+ }