From f94330b3e451c76e23c8519cca66f83b630afcd0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 28 Jul 2018 12:13:52 -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. Should fix some cases where "Entity is still in another chunk section" Related to #1223 --- ...rocess-chunk-removal-in-removeEntity.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch diff --git a/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch b/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch new file mode 100644 index 0000000000..1a96ccc29b --- /dev/null +++ b/Spigot-Server-Patches/Always-process-chunk-removal-in-removeEntity.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +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 d2d2ab794..df98a4f44 100644 +--- a/src/main/java/net/minecraft/server/World.java ++++ b/src/main/java/net/minecraft/server/World.java +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + 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.ab; + int j = entity.ad; + +@@ -0,0 +0,0 @@ public abstract class World implements IBlockAccess { + this.getChunkAt(i, j).b(entity); + } + ++ 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) { +-- \ No newline at end of file