Paper/patches/server/0597-Remove-stale-POIs.patch

23 lines
1.2 KiB
Diff
Raw Normal View History

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 01abe5e21639b990e5ae6d2021cd86149ddf93e5..4223d4610b4fec588980dba2ea5ec4f04c45d945 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1703,6 +1703,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
});
optional1.ifPresent((villageplacetype) -> {
this.getServer().execute(() -> {
+ // Paper start
+ if (!optional.isPresent() && this.getPoiManager().exists(blockposition1, com.google.common.base.Predicates.alwaysTrue())) {
+ this.getPoiManager().remove(blockposition1);
+ }
+ // Paper end
this.getPoiManager().add(blockposition1, villageplacetype);
DebugPackets.sendPoiAddedPacket(this, blockposition1);
});