3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-15 12:30:06 +01:00
Paper/removed/1.15/0412-Improve-POI-data-saving-logic.patch
MiniDigger 44d032f1e9 Houston, we got a patch (#2731)
* Houston, we got a patch

* is this the end of the beginning or the beginning of the end
2019-12-12 16:20:43 +00:00

31 Zeilen
1.5 KiB
Diff

From cf3689f611fad7d903831b63086deefad3cd8e92 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
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