PaperMC/Spigot-Server-Patches/0342-Always-process-chunk-removal-in-removeEntity.patch

34 lines
1.4 KiB
Diff
Raw Normal View History

From 20049c46e31b0cfdfada2378245312927a620308 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 2a4405638e..eabcb4c8f9 100644
--- a/src/main/java/net/minecraft/server/World.java
+++ b/src/main/java/net/minecraft/server/World.java
@@ -1274,7 +1274,7 @@ 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;
@@ -1282,6 +1282,7 @@ 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) {
--
2.18.0