aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch
diff options
context:
space:
mode:
authorZach Brown <[email protected]>2019-09-29 15:02:04 -0500
committerZach Brown <[email protected]>2019-09-29 15:02:04 -0500
commit89eb8902395f0a38b88d8f149658d846f88ee293 (patch)
tree99f6ca0a8d67525272bacbe8b0d2422bce6d6661 /Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch
parent27fca92fa13b0142b447d4919e2750afa644fc84 (diff)
downloadPaper-89eb8902395f0a38b88d8f149658d846f88ee293.tar.gz
Paper-89eb8902395f0a38b88d8f149658d846f88ee293.zip
[CI-SKIP] Rebuild patches
Diffstat (limited to 'Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch')
-rw-r--r--Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch b/Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch
new file mode 100644
index 0000000000..52d36f27c1
--- /dev/null
+++ b/Spigot-Server-Patches/0412-Improve-POI-data-saving-logic.patch
@@ -0,0 +1,30 @@
+From cf3689f611fad7d903831b63086deefad3cd8e92 Mon Sep 17 00:00:00 2001
+From: Spottedleaf <[email protected]>
+Date: Mon, 19 Aug 2019 06:33:17 -0700
+Subject: [PATCH] Improve POI data saving logic
+
+- Do not unload data if world saving is disabled
+- Aggressively target unloading
+
+diff --git a/src/main/java/net/minecraft/server/VillagePlace.java b/src/main/java/net/minecraft/server/VillagePlace.java
+index 0e98b7803..fb99b4306 100644
+--- a/src/main/java/net/minecraft/server/VillagePlace.java
++++ b/src/main/java/net/minecraft/server/VillagePlace.java
+@@ -132,9 +132,12 @@ public class VillagePlace extends RegionFileSection<VillagePlaceSection> {
+ // Paper start - async chunk io
+ if (this.world == null) {
+ super.a(booleansupplier);
+- } else {
++ } else if (!this.world.isSavingDisabled()) { // Paper - only save if saving is enabled
+ //super.a(booleansupplier); // re-implement below
+- while (!((RegionFileSection)this).d.isEmpty() && booleansupplier.getAsBoolean()) {
++ // Paper start - target unloading aggressively
++ int queueTarget = Math.min(this.d.size() - 100, (int)(this.d.size() * 0.96));
++ while (!((RegionFileSection)this).d.isEmpty() && (this.d.size() > queueTarget || booleansupplier.getAsBoolean())) {
++ // Paper end
+ ChunkCoordIntPair chunkcoordintpair = SectionPosition.a(((RegionFileSection)this).d.firstLong()).u();
+
+ NBTTagCompound data;
+--
+2.23.0
+