diff --git a/patches/server/Configurable-projectile-relative-velocity.patch b/patches/server/Configurable-projectile-relative-velocity.patch index a6e85dc382..63ce2091f6 100644 --- a/patches/server/Configurable-projectile-relative-velocity.patch +++ b/patches/server/Configurable-projectile-relative-velocity.patch @@ -29,11 +29,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java +++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java @@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity { + this.shoot((double) f5, (double) f6, (double) f7, speed, divergence); Vec3 vec3d = shooter.getKnownMovement(); - -- this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z)); -+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z)); // Paper - allow disabling relative velocity +- ++ // Paper start - allow disabling relative velocity ++ if (vec3d.lengthSqr() > 4D * 4D) { ++ vec3d = vec3d.normalize().scale(2D); ++ } ++ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) { + this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z)); ++ } ++ // Paper end - allow disabling relative velocity } // CraftBukkit start - call projectile hit event