Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
de04cbced5
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: f29cb801 Separate checkstyle-suppressions file is not required 86f99bbe SPIGOT-7540, PR-946: Add ServerTickManager API d4119585 SPIGOT-6903, PR-945: Add BlockData#getMapColor b7a2ed41 SPIGOT-7530, PR-947: Add Player#removeResourcePack 9dd56255 SPIGOT-7527, PR-944: Add WindCharge#explode() 994a6163 Attempt upgrade of resolver libraries CraftBukkit Changes: b3b43a6ad Add Checkstyle check for unused imports 13fb3358e SPIGOT-7544: Scoreboard#getEntries() doesn't get entries but class names 3dda99c06 SPIGOT-7540, PR-1312: Add ServerTickManager API 2ab4508c0 SPIGOT-6903, PR-1311: Add BlockData#getMapColor 1dbdbbed4 PR-1238: Remove unnecessary sign ticking 659728d2a MC-264285, SPIGOT-7439, PR-1237: Fix unbreakable flint and steel is completely consumed while igniting creeper e37e29ce0 Increase outdated build delay c00438b39 SPIGOT-7530, PR-1313: Add Player#removeResourcePack 492dd80ce SPIGOT-7527, PR-1310: Add WindCharge#explode() e11fbb9d7 Upgrade MySQL driver 9f3a0bd2a Attempt upgrade of resolver libraries 60d16d7ca PR-1306: Centralize Bukkit and Minecraft entity conversion Spigot Changes: 06d602e7 Rebuild patches
40 Zeilen
2.5 KiB
Diff
40 Zeilen
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Lucavon <lucavonlp@gmail.com>
|
|
Date: Tue, 23 Jul 2019 20:29:20 -0500
|
|
Subject: [PATCH] Configurable projectile relative velocity
|
|
|
|
This patch adds an option "disable relative projectile velocity", which, when
|
|
enabled, will cause projectiles to ignore the shooter's current velocity,
|
|
like they did in Minecraft 1.8 and prior.
|
|
If a player is falling, for example, their shooting range will be drastically
|
|
reduced, as a downwards velocity is applied to the projectile. This prevents
|
|
players from saving themselves from falling off floating islands, for example,
|
|
as a thrown ender pearl will not make it back to the island, while it would
|
|
have in 1.8.
|
|
|
|
While this could easily be done with plugins, too, there are multiple problems:
|
|
P1) If multiple plugins cancel the velocity by subtracting the shooter's velocity
|
|
from the projectile's velocity, the projectile's velocity would be different.
|
|
As there's no way to detect whether the projectile's velocity has already been
|
|
adjusted to ignore the player's velocity, plugins can't not do it if it's not
|
|
necessary.
|
|
P2) I've noticed some inconsistencies, e.g. weird velocity when shooting while
|
|
using an elytra. Checking for those inconsistencies is possible, but not as
|
|
efficient as just not applying the velocity in the first place.
|
|
P3) Solutions for 1) and especially 2) might not be future-proof, while this
|
|
server-internal fix makes this change future-proof.
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
index 01a2c6c3ee4e1500b6ee9986943f84dbe8663860..444119c813af920eb25706341106f0fea27befa8 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
|
@@ -173,7 +173,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
|
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
|
Vec3 vec3d = shooter.getDeltaMovement();
|
|
|
|
- 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
|
|
}
|
|
|
|
// CraftBukkit start - call projectile hit event
|