aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0577-Remove-stale-POIs.patch
blob: 0dfcb57c094339f2e6bdc877aa765893b26e9d93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 1a79c9767dd6e207653d59532b00742a1d85f314..7f2f47c16b15be32347f0e1689ac69fc6d6d0c2d 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1823,6 +1823,11 @@ public class ServerLevel extends Level implements WorldGenLevel {
             });
             optional1.ifPresent((villageplacetype) -> {
                 this.getServer().execute(() -> {
+                    // Paper start
+                    if (optional.isEmpty() && this.getPoiManager().exists(blockposition1, poiType -> true)) {
+                        this.getPoiManager().remove(blockposition1);
+                    }
+                    // Paper end
                     this.getPoiManager().add(blockposition1, villageplacetype);
                     DebugPackets.sendPoiAddedPacket(this, blockposition1);
                 });