2021-06-11 14:02:28 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2024-10-30 14:06:43 +01:00
|
|
|
From: Nassim Jahnke <nassim@njahnke.dev>
|
|
|
|
Date: Wed, 30 Oct 2024 13:51:54 +0100
|
|
|
|
Subject: [PATCH] Fix item EAR ticks
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2024-10-30 14:06:43 +01:00
|
|
|
Item entities only have their gravity ticked every 4 ticks when on ground.
|
|
|
|
Fix that and also remove Spigot's arbitrary tick skipping. It's a terribly
|
|
|
|
cheap way of getting extra performance that doesn't really work at all.
|
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
|
2024-10-30 14:06:43 +01:00
|
|
|
index 75ebf09777e19645eee296a9edabac39c858ffb9..c21fa55c62d97d9511e41a1e313e904330a6eee6 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
|
2024-09-19 16:36:07 +02:00
|
|
|
@@ -175,7 +175,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-07 23:14:56 +02:00
|
|
|
- if (!this.onGround() || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || (this.tickCount + this.getId()) % 4 == 0) {
|
2024-10-30 14:06:43 +01:00
|
|
|
+ if (!this.onGround() || this.getDeltaMovement().horizontalDistanceSqr() > 9.999999747378752E-6D || (this.tickCount + this.getId()) % 4 == 0) { // Paper - Diff on change; ActivationRange immunity
|
2021-06-11 14:02:28 +02:00
|
|
|
this.move(MoverType.SELF, this.getDeltaMovement());
|
2024-10-23 15:54:09 +02:00
|
|
|
this.applyEffectsFromBlocks();
|
2024-04-24 08:05:14 +02:00
|
|
|
float f = 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
|
2024-11-05 10:52:18 +01:00
|
|
|
index bd522080d17b5b470ec3ab42aa4ecc3082248c8a..84ff1210e944ea9d1ec88874d218458773e341c9 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
|
2024-11-05 10:52:18 +01:00
|
|
|
@@ -234,7 +234,7 @@ 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;
|
|
|
|
}
|
|
|
|
|
2024-11-04 18:42:38 +01:00
|
|
|
@@ -253,11 +253,8 @@ public class ActivationRange
|
2024-10-30 14:06:43 +01:00
|
|
|
}
|
2022-01-19 20:18:24 +01:00
|
|
|
isActive = true;
|
|
|
|
}
|
2024-10-30 14:06:43 +01:00
|
|
|
- // Add a little performance juice to active entities. Skip 1/4 if not immune.
|
2022-01-19 20:18:24 +01:00
|
|
|
- } else if ( !entity.defaultActivationState && entity.tickCount % 4 == 0 && !ActivationRange.checkEntityImmunities( entity ) )
|
2024-10-30 14:06:43 +01:00
|
|
|
- {
|
|
|
|
- isActive = false;
|
2022-01-19 20:18:24 +01:00
|
|
|
}
|
2024-10-30 14:06:43 +01:00
|
|
|
+ // Paper - remove dumb tick skipping for active entities
|
|
|
|
return isActive;
|
|
|
|
}
|
|
|
|
}
|