aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0311-Fix-items-not-falling-correctly.patch
diff options
context:
space:
mode:
authorRiley Park <[email protected]>2024-05-15 17:06:59 -0700
committerGitHub <[email protected]>2024-05-15 17:06:59 -0700
commitf17519338bc589c045e0b32bfc37e048b23544d5 (patch)
treee50182ec698b4a9de8f366f485ee089b1901bbd9 /patches/server/0311-Fix-items-not-falling-correctly.patch
parent3fc93581bb876e8149b2ca423375a98f5ca12d27 (diff)
downloadPaper-f17519338bc589c045e0b32bfc37e048b23544d5.tar.gz
Paper-f17519338bc589c045e0b32bfc37e048b23544d5.zip
Expose server build information (#10729)
* Expose server build information * squash patches * final tweaks --------- Co-authored-by: Jake Potrebic <[email protected]> Co-authored-by: masmc05 <[email protected]>
Diffstat (limited to 'patches/server/0311-Fix-items-not-falling-correctly.patch')
-rw-r--r--patches/server/0311-Fix-items-not-falling-correctly.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/server/0311-Fix-items-not-falling-correctly.patch b/patches/server/0311-Fix-items-not-falling-correctly.patch
new file mode 100644
index 0000000000..a9746d7d4e
--- /dev/null
+++ b/patches/server/0311-Fix-items-not-falling-correctly.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: AJMFactsheets <[email protected]>
+Date: Fri, 17 Jan 2020 17:17:54 -0600
+Subject: [PATCH] Fix items not falling correctly
+
+Since 1.14, Mojang has added an optimization which skips checking if
+an item should fall every fourth tick.
+
+However, Spigot's entity activation range class also has an
+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 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 f0e6375236d61f32235ed23c3bae49db1545d1a2..5782033cbe408f60340833ddb49dbca3623aaa83 100644
+--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
++++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+@@ -175,7 +175,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
+ }
+ }
+
+- 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 + this.getId()) % 4 == 0) { // Paper - Diff on change
+ this.move(MoverType.SELF, this.getDeltaMovement());
+ float f = 0.98F;
+
+diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
+index 6d51464f6368151e8acc532414ee223714584e96..9fb9fa62c32445ac3c3883a6433759c86dcfc428 100644
+--- a/src/main/java/org/spigotmc/ActivationRange.java
++++ b/src/main/java/org/spigotmc/ActivationRange.java
+@@ -256,7 +256,7 @@ 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()) % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) ) // Paper - Ensure checking item movement is offset from Spigot's entity activation range check
+ {
+ isActive = false;
+ }