From 5d6137bcc927b22549442228ee0fec42455e726a Mon Sep 17 00:00:00 2001 From: Shane Freeder <theboyetronic@gmail.com> Date: Thu, 19 Sep 2024 15:27:33 +0100 Subject: [PATCH] Only mark decorations dirty if a removal actually occurs (#11413) * Only mark decorations dirty if a removal actually occurs Vanilla calls this method blindly inside of a loop which erroniously marks map data files as being dirty even if nothing has actually changed. * Merge into existing patch --------- Co-authored-by: Bjarne Koll <git@lynxplay.dev> --- ...ve-Maps-in-item-frames-performance-and-bug-fixe.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index e47ef072e0..011a1f9530 100644 --- a/patches/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/patches/server/Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -72,6 +72,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 RegistryOps<Tag> registryops = registryLookup.createSerializationContext(NbtOps.INSTANCE); List<MapBanner> list = (List) MapBanner.LIST_CODEC.parse(registryops, nbt.get("banners")).resultOrPartial((s) -> { @@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData { + --this.trackedDecorationCount; + } + +- this.setDecorationsDirty(); ++ if (mapicon != null) this.setDecorationsDirty(); // Paper - only mark dirty if a change occurs + } + + public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, Holder<MapDecorationType> decorationType) { +@@ -0,0 +0,0 @@ public class MapItemSavedData extends SavedData { public class HoldingPlayer {