aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2021-04-21 20:04:42 +0100
committerShane Freeder <[email protected]>2021-04-21 20:04:42 +0100
commita9525a6f71e4efedaac60a27dc302b7f82fdff0e (patch)
tree18e2514899e995115a46c784a2c9b3c74adec9e2
parent39bf5b525d819e50a18a241f3ebaf388a571619c (diff)
downloadPaper-a9525a6f71e4efedaac60a27dc302b7f82fdff0e.tar.gz
Paper-a9525a6f71e4efedaac60a27dc302b7f82fdff0e.zip
Do not schedule poi task for each block write on chunk gen
Most of the time optional == optional1, so we shouldn't schedule a task for each write.
-rw-r--r--Spigot-Server-Patches/0645-Remove-stale-POIs.patch32
1 files changed, 13 insertions, 19 deletions
diff --git a/Spigot-Server-Patches/0645-Remove-stale-POIs.patch b/Spigot-Server-Patches/0645-Remove-stale-POIs.patch
index 0984ac1923..05bd91ba67 100644
--- a/Spigot-Server-Patches/0645-Remove-stale-POIs.patch
+++ b/Spigot-Server-Patches/0645-Remove-stale-POIs.patch
@@ -5,28 +5,22 @@ Subject: [PATCH] Remove stale POIs
diff --git a/src/main/java/net/minecraft/server/level/WorldServer.java b/src/main/java/net/minecraft/server/level/WorldServer.java
-index 4a87b9ebc2a584d8a2fca874342057e81fbbc1c6..bf9bf8368b345bf0ac3b14a08e8342f7bd63dead 100644
+index 4a87b9ebc2a584d8a2fca874342057e81fbbc1c6..c38ef337f9a662d689994a0d530e8e655b843177 100644
--- a/src/main/java/net/minecraft/server/level/WorldServer.java
+++ b/src/main/java/net/minecraft/server/level/WorldServer.java
-@@ -2067,8 +2067,16 @@ public class WorldServer extends World implements GeneratorAccessSeed {
- Optional<VillagePlaceType> optional = VillagePlaceType.b(iblockdata);
- Optional<VillagePlaceType> optional1 = VillagePlaceType.b(iblockdata1);
-
-+ // Paper start
-+ BlockPosition blockposition1 = blockposition.immutableCopy();
-+ this.getMinecraftServer().execute(() -> {
-+ if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) {
-+ this.getPoiStorage().remove(blockposition1);
-+ }
-+ });
- if (!Objects.equals(optional, optional1)) {
-- BlockPosition blockposition1 = blockposition.immutableCopy();
-+ //BlockPosition blockposition1 = blockposition.immutableCopy();
-+ // Paper end
-
- optional.ifPresent((villageplacetype) -> {
+@@ -2078,6 +2078,11 @@ public class WorldServer extends World implements GeneratorAccessSeed {
+ });
+ optional1.ifPresent((villageplacetype) -> {
this.getMinecraftServer().execute(() -> {
-@@ -2085,6 +2093,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
++ // Paper start
++ if (!optional.isPresent() && this.getPoiStorage().test(blockposition1, com.google.common.base.Predicates.alwaysTrue())) {
++ this.getPoiStorage().remove(blockposition1);
++ }
++ // Paper end
+ this.y().a(blockposition1, villageplacetype);
+ PacketDebug.a(this, blockposition1);
+ });
+@@ -2085,6 +2090,7 @@ public class WorldServer extends World implements GeneratorAccessSeed {
}
}