Remove stale POIs
This commit is contained in:
49
Spigot-Server-Patches/Remove-stale-POIs.patch
Normal file
49
Spigot-Server-Patches/Remove-stale-POIs.patch
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
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/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/VillagePlace.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/VillagePlace.java
|
||||||
|
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||||
|
((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition, villageplacetype);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public void remove(BlockPosition blockposition) { this.a(blockposition); } // Paper - OBFHELPER
|
||||||
|
public void a(BlockPosition blockposition) {
|
||||||
|
((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).a(blockposition);
|
||||||
|
}
|
||||||
|
@@ -0,0 +0,0 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
|
||||||
|
return ((VillagePlaceSection) this.e(SectionPosition.a(blockposition).s())).c(blockposition);
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public final boolean test(BlockPosition blockposition, Predicate<VillagePlaceType> predicate) { return this.a(blockposition, predicate); } // Paper - OBFHELPER
|
||||||
|
public boolean a(BlockPosition blockposition, Predicate<VillagePlaceType> predicate) {
|
||||||
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
|
+++ b/src/main/java/net/minecraft/server/WorldServer.java
|
||||||
|
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||||
|
Optional<VillagePlaceType> optional = VillagePlaceType.b(iblockdata);
|
||||||
|
Optional<VillagePlaceType> optional1 = VillagePlaceType.b(iblockdata1);
|
||||||
|
|
||||||
|
+ // Paper start
|
||||||
|
+ 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();
|
||||||
|
|
||||||
|
@@ -0,0 +0,0 @@ public class WorldServer extends World implements GeneratorAccessSeed {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ public final VillagePlace getPoiStorage() { return this.y(); } // Paper - OBFHELPER
|
||||||
|
public VillagePlace y() {
|
||||||
|
return this.getChunkProvider().j();
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user