From 404a4945d00cfb9d3fb4dfa2263e8d176c1c988b Mon Sep 17 00:00:00 2001 From: MrPowerGamerBR Date: Wed, 5 Jun 2024 15:29:03 -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 --- ...flag-when-loading-maps-from-the-disk.patch | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 patches/server/0020-Reset-dirty-flag-when-loading-maps-from-the-disk.patch diff --git a/patches/server/0020-Reset-dirty-flag-when-loading-maps-from-the-disk.patch b/patches/server/0020-Reset-dirty-flag-when-loading-maps-from-the-disk.patch new file mode 100644 index 0000000..51f7ee7 --- /dev/null +++ b/patches/server/0020-Reset-dirty-flag-when-loading-maps-from-the-disk.patch @@ -0,0 +1,21 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrPowerGamerBR +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; + } +