9
0
mirror of https://github.com/SparklyPower/SparklyPaper.git synced 2025-12-19 15:09:27 +00:00

Reset dirty flag when loading maps from the disk

By default, the server will start rewriting all map datas to the disk after loading it, even if the map didn't have any changes

This also slows down world saving a lot if you have a lot of maps
This commit is contained in:
MrPowerGamerBR
2024-06-05 15:29:03 -03:00
parent 0710140816
commit 404a4945d0

View File

@@ -0,0 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Wed, 5 Jun 2024 15:20:00 -0300
Subject: [PATCH] Reset dirty flag when loading maps from the disk
By default, the server will start rewriting all map datas to the disk after loading it, even if the map didn't have any changes
This also slows down world saving a lot if you have a lot of maps
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 6e3eb9a28b6c190acfe37a03efce573da2da2749..135f282ad4ab70837f762d183ffab62f2a75d763 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -217,6 +217,7 @@ public class MapItemSavedData extends SavedData {
}
}
+ worldmap.setDirty(false); // SparklyPaper - reset dirty flag when loading maps from the disk
return worldmap;
}