diff options
author | Shane Freeder <[email protected]> | 2024-09-19 15:27:33 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-19 16:27:33 +0200 |
commit | 5c829557332f21b34bc81e6ad1a73e511faef8f6 (patch) | |
tree | d887804a7eeb74600ce17518e174ac221eca0103 | |
parent | 2aaf4369b61256c28c205ec1152132760b310ebd (diff) | |
download | Paper-5c829557332f21b34bc81e6ad1a73e511faef8f6.tar.gz Paper-5c829557332f21b34bc81e6ad1a73e511faef8f6.zip |
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 <[email protected]>
-rw-r--r-- | patches/server/0987-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/patches/server/0987-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch b/patches/server/0987-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch index ccc8786fd8..30dde1fadd 100644 --- a/patches/server/0987-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch +++ b/patches/server/0987-Improve-Maps-in-item-frames-performance-and-bug-fixe.patch @@ -44,7 +44,7 @@ index d0b51d96d6795b5fa03bc195b90324680545b752..09bcbc0ae36e4e69fee87a7e0c49acf4 return entityitem; } 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 a43544704109f21bab230dd9bf0401e28f878582..17f33c83c6033564d6bf4fbd388b0b847c68adb3 100644 +index a43544704109f21bab230dd9bf0401e28f878582..6794466051dd4b725d579b2136c37844995a648e 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 @@ -79,6 +79,7 @@ public class MapItemSavedData extends SavedData { @@ -71,6 +71,15 @@ index a43544704109f21bab230dd9bf0401e28f878582..17f33c83c6033564d6bf4fbd388b0b84 RegistryOps<Tag> registryops = registryLookup.createSerializationContext(NbtOps.INSTANCE); List<MapBanner> list = (List) MapBanner.LIST_CODEC.parse(registryops, nbt.get("banners")).resultOrPartial((s) -> { +@@ -348,7 +351,7 @@ 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) { @@ -588,6 +591,21 @@ public class MapItemSavedData extends SavedData { public class HoldingPlayer { |