mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Check shooter in configurable projectile relative velocity patch
This commit is contained in:
parent
bc48955246
commit
f117e53094
1 changed files with 10 additions and 3 deletions
|
@ -29,11 +29,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||||
+++ b/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 {
|
@@ -0,0 +0,0 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||||
|
|
||||||
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
||||||
Vec3 vec3d = shooter.getKnownMovement();
|
Vec3 vec3d = shooter.getKnownMovement();
|
||||||
|
-
|
||||||
- this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
+ // Paper start - allow disabling relative velocity
|
||||||
+ 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
|
+ 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
|
// CraftBukkit start - call projectile hit event
|
||||||
|
|
Loading…
Reference in a new issue