diff --git a/patches/server/Entity-Activation-Range-2.0.patch b/patches/server/Entity-Activation-Range-2.0.patch index 5d7a0d9c4a..f8c1338322 100644 --- a/patches/server/Entity-Activation-Range-2.0.patch +++ b/patches/server/Entity-Activation-Range-2.0.patch @@ -681,8 +681,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } // Add a little performance juice to active entities. Skip 1/4 if not immune. -- } else if ( !entity.defaultActivationState && entity.tickCount % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) -+ } else if ( entity.tickCount % 4 == 0 && ActivationRange.checkEntityImmunities( entity ) < 0 ) // Paper +- } else if ( !entity.defaultActivationState && entity.tickCount + entity.getId() + 1 % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check ++ } else if ( entity.tickCount + entity.getId() + 1 % 4 == 0 && ActivationRange.checkEntityImmunities( entity ) < 0 ) // Paper { isActive = false; } diff --git a/patches/server/Fix-items-not-falling-correctly.patch b/patches/server/Fix-items-not-falling-correctly.patch index fc55d33746..47f5cc9a66 100644 --- a/patches/server/Fix-items-not-falling-correctly.patch +++ b/patches/server/Fix-items-not-falling-correctly.patch @@ -11,8 +11,8 @@ optimization which skips ticking active entities every fourth tick. This can result in a state where an item will never properly fall due to its move method never being called. -This patch resolves the conflict by offsetting checking an item's -move method from Spigot's entity activation range check. +This patch resolves the conflict by offsetting checking Spigot's entity +activation range check from an item's move method. diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 @@ -23,7 +23,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - if (!this.onGround || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || (this.tickCount + this.getId()) % 4 == 0) { -+ if (!this.onGround || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || this.tickCount % 4 == 0) { // Paper - Ensure checking item movement is always offset from Spigot's entity activation range check ++ if (!this.onGround || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || (this.tickCount + this.getId()) % 4 == 0) { // Paper - Diff on change this.move(MoverType.SELF, this.getDeltaMovement()); float f1 = 0.98F; +diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java +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 + isActive = true; + } + // Add a little performance juice to active entities. Skip 1/4 if not immune. +- } else if ( !entity.defaultActivationState && entity.tickCount % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) ++ } else if ( !entity.defaultActivationState && entity.tickCount + entity.getId() + 1 % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check + { + isActive = false; + }