2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: AJMFactsheets <AJMFactsheets@gmail.com>
|
|
|
|
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.
|
|
|
|
|
2022-01-19 20:18:24 +01:00
|
|
|
This patch resolves the conflict by offsetting checking Spigot's entity
|
|
|
|
activation range check from an item's move method.
|
2021-06-11 14:02:28 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
2023-03-14 20:54:57 +01:00
|
|
|
index 007625b1a121f1e7241f7cbfba0b1f168e8be5df..6836288bd380651007f3aa76e608767f612f6644 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
|
|
|
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
|
2023-03-14 20:54:57 +01:00
|
|
|
@@ -149,7 +149,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-13 21:29:58 +02:00
|
|
|
- if (!this.onGround || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || (this.tickCount + this.getId()) % 4 == 0) {
|
2022-01-19 20:18:24 +01:00
|
|
|
+ if (!this.onGround || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || (this.tickCount + this.getId()) % 4 == 0) { // Paper - Diff on change
|
2021-06-11 14:02:28 +02:00
|
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
|
|
|
float f1 = 0.98F;
|
|
|
|
|
2022-01-19 20:18:24 +01:00
|
|
|
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
|
2023-01-07 13:05:13 +01:00
|
|
|
index e2dfc4d9a16a738dd0fe91838603e1d4370afa56..08bf9f85fe02a3f89640a2f3ae23089a119a394a 100644
|
2022-01-19 20:18:24 +01:00
|
|
|
--- a/src/main/java/org/spigotmc/ActivationRange.java
|
|
|
|
+++ b/src/main/java/org/spigotmc/ActivationRange.java
|
2022-09-26 10:02:51 +02:00
|
|
|
@@ -257,7 +257,7 @@ public class ActivationRange
|
2022-01-19 20:18:24 +01:00
|
|
|
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 ) )
|
2023-01-07 13:05:13 +01:00
|
|
|
+ } 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
|
2022-01-19 20:18:24 +01:00
|
|
|
{
|
|
|
|
isActive = false;
|
|
|
|
}
|