aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0306-Always-process-chunk-removal-in-removeEntity.patch
diff options
context:
space:
mode:
Diffstat (limited to 'Spigot-Server-Patches/0306-Always-process-chunk-removal-in-removeEntity.patch')
-rw-r--r--Spigot-Server-Patches/0306-Always-process-chunk-removal-in-removeEntity.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0306-Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/0306-Always-process-chunk-removal-in-removeEntity.patch
new file mode 100644
index 0000000000..dc13c6bbc9
--- /dev/null
+++ b/Spigot-Server-Patches/0306-Always-process-chunk-removal-in-removeEntity.patch
@@ -0,0 +1,32 @@
+From f88a68c596f190756119dec505888c50d543fc1b Mon Sep 17 00:00:00 2001
+From: Aikar <[email protected]>
+Date: Sat, 28 Jul 2018 12:09:20 -0400
+Subject: [PATCH] Always process chunk removal in removeEntity
+
+Spigot might skip chunk registration changes in removeEntity
+which can keep them in the chunk when they shouldnt be if done
+during entity ticking.
+
+diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java
+index 1929e9d2ae..1cbe6e17b7 100644
+--- a/src/main/java/net/minecraft/server/World.java
++++ b/src/main/java/net/minecraft/server/World.java
+@@ -1107,13 +1107,14 @@ public abstract class World implements IEntityAccess, GeneratorAccess, IIBlockAc
+ this.everyoneSleeping();
+ }
+
+- if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking
++ // if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - move down
+ int i = entity.chunkX;
+ int j = entity.chunkZ;
+
+ Chunk chunk = entity.getCurrentChunk(); // Paper
+ if (chunk != null) chunk.removeEntity(entity); // Paper
+
++ if (!guardEntityList) { // Spigot - It will get removed after the tick if we are ticking // Paper - always remove from current chunk above
+ // CraftBukkit start - Decrement loop variable field if we've already ticked this entity
+ int index = this.entityList.indexOf(entity);
+ if (index != -1) {
+--
+2.21.0
+