From 6bf12bff7188cbd4f25563a70022cc744319072c Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Sat, 9 Jan 2021 13:32:26 +0000 Subject: [PATCH] Ensure POI removal occurs on the correct thread --- Spigot-Server-Patches/0648-Remove-stale-POIs.patch | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/0648-Remove-stale-POIs.patch b/Spigot-Server-Patches/0648-Remove-stale-POIs.patch index bc754b217..ec7bc81db 100644 --- a/Spigot-Server-Patches/0648-Remove-stale-POIs.patch +++ b/Spigot-Server-Patches/0648-Remove-stale-POIs.patch @@ -25,21 +25,24 @@ index b926cebd053bef829517c9d9bbf1c609c23ca04a..6a0f07b13eef5560dfc7c7b39618c0b8 return (Boolean) this.d(SectionPosition.a(blockposition).s()).map((villageplacesection) -> { return villageplacesection.a(blockposition, predicate); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index 5b0b6edfa790918e56399ff6c83f3feb6e5aca49..9b6dbadcbae284e089e38b21b596d78624d48ddd 100644 +index 5b0b6edfa790918e56399ff6c83f3feb6e5aca49..b033ff44373ec87702946c3cefe664fb46d609f4 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java -@@ -1942,6 +1942,10 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1942,6 +1942,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { Optional optional = VillagePlaceType.b(iblockdata); Optional optional1 = VillagePlaceType.b(iblockdata1); + // Paper start -+ if (!optional.isPresent() && this.getPoiStorage().test(blockposition, com.google.common.base.Predicates.alwaysTrue())) -+ this.getPoiStorage().remove(blockposition); ++ this.getMinecraftServer().execute(() -> { ++ if (!optional.isPresent() && this.getPoiStorage().test(blockposition, com.google.common.base.Predicates.alwaysTrue())) { ++ this.getPoiStorage().remove(blockposition); ++ } ++ }); + // Paper end if (!Objects.equals(optional, optional1)) { BlockPosition blockposition1 = blockposition.immutableCopy(); -@@ -1960,6 +1964,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { +@@ -1960,6 +1967,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } }