From 422cd8d65d715f127750302d075116b42e38ea6c Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Tue, 5 Nov 2024 10:52:18 +0100 Subject: [PATCH] Correctly adopt upstream item EAR fix (#11582) EAR 2 evaluates the entities activity on the already incremented entity tick. This diverges from spigots behaviour and hence needed adoption for their item ear fix. --- patches/server/Entity-Activation-Range-2.0.patch | 2 +- patches/server/Fix-item-EAR-ticks.patch | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/patches/server/Entity-Activation-Range-2.0.patch b/patches/server/Entity-Activation-Range-2.0.patch index 5526fa47fc..d9a21e0900 100644 --- a/patches/server/Entity-Activation-Range-2.0.patch +++ b/patches/server/Entity-Activation-Range-2.0.patch @@ -669,7 +669,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 /** @@ -0,0 +0,0 @@ public class ActivationRange - if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId() + 1) % 4 == 0)) { + if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0)) { // Paper - Needed for item gravity, see ItemEntity tick return true; } + // Paper start - special case always immunities diff --git a/patches/server/Fix-item-EAR-ticks.patch b/patches/server/Fix-item-EAR-ticks.patch index 928837b5ab..7b289a2c54 100644 --- a/patches/server/Fix-item-EAR-ticks.patch +++ b/patches/server/Fix-item-EAR-ticks.patch @@ -24,6 +24,15 @@ diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/spigotmc/ActivationRange.java +++ b/src/main/java/org/spigotmc/ActivationRange.java +@@ -0,0 +0,0 @@ public class ActivationRange + public static boolean checkIfActive(Entity entity) + { + // Never safe to skip fireworks or item gravity +- if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId() + 1) % 4 == 0)) { ++ if (entity instanceof FireworkRocketEntity || (entity instanceof ItemEntity && (entity.tickCount + entity.getId()) % 4 == 0)) { // Paper - Needed for item gravity, see ItemEntity tick + return true; + } + @@ -0,0 +0,0 @@ public class ActivationRange } isActive = true;