Paper/patches/server/0486-Remove-stale-POIs.patch
2024-04-24 09:46:45 -04:00

23 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Shane Freeder <theboyetronic@gmail.com>
Date: Sat, 9 Jan 2021 14:17:07 +0100
Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4e1027f00fba2084073aa926805753224aa8b153..2c1ca55e1919c29956b3d95f65f8f08eb7529d1e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1743,6 +1743,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
optional1.ifPresent((holder) -> {
this.getServer().execute(() -> {
+ // Paper start - Remove stale POIs
+ if (optional.isEmpty() && this.getPoiManager().exists(blockposition1, poiType -> true)) {
+ this.getPoiManager().remove(blockposition1);
+ }
+ // Paper end - Remove stale POIs
this.getPoiManager().add(blockposition1, holder);
DebugPackets.sendPoiAddedPacket(this, blockposition1);
});