Paper/patches/server/0598-Remove-stale-POIs.patch
Jason 4dd33cb8b6
[ci skip] Drop "Fix CME on adding a passenger in CreatureSpawnEvent" (#6384)
This is no longer needed as Entity#passengers is an ImmutableList as of 1.17
2021-08-14 03:01:07 -07:00

23 Zeilen
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 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);
});