Skip to content

Commit

Permalink
Fix duplicate mark map decorations dirty
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Oct 2, 2024
1 parent 532da4b commit 6ffcb57
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ index cf78531b193ba56991ccb0c4f62844208e4a5706..d6cecc788be59676f0d011323bb5bdab
itemstack.consume(1, player);
}
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 b794c097039f6a3f812dd76df407587594d3ac49..20c1272b381e2eecc814e3547c3daff04c5319f8 100644
index b794c097039f6a3f812dd76df407587594d3ac49..dacfac988b94a86f214dd530e08064cd6685afc8 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
@@ -80,6 +80,16 @@ public class MapItemSavedData extends SavedData {
Expand All @@ -127,23 +127,24 @@ index b794c097039f6a3f812dd76df407587594d3ac49..20c1272b381e2eecc814e3547c3daff0
public boolean isExplorerMap; // Purpur

// CraftBukkit start
@@ -353,6 +363,7 @@ public class MapItemSavedData extends SavedData {
@@ -352,7 +362,7 @@ public class MapItemSavedData extends SavedData {
--this.trackedDecorationCount;
}

if (mapicon != null) this.setDecorationsDirty(); // Paper - only mark dirty if a change occurs
- if (mapicon != null) this.setDecorationsDirty(); // Paper - only mark dirty if a change occurs
+ if (mapicon != null && mapicon.renderOnFrame()) this.dirtyFrameDecorations = true; // Paper
}

public static void addTargetDecoration(ItemStack stack, BlockPos pos, String id, Holder<MapDecorationType> decorationType) {
@@ -434,6 +445,7 @@ public class MapItemSavedData extends SavedData {
@@ -434,6 +444,7 @@ public class MapItemSavedData extends SavedData {
}

this.setDecorationsDirty();
+ if (type.value().showOnItemFrame() || (mapicon1 != null && mapicon.type().value().showOnItemFrame())) this.dirtyFrameDecorations = true; // Paper
}

}
@@ -447,6 +459,20 @@ public class MapItemSavedData extends SavedData {
@@ -447,6 +458,20 @@ public class MapItemSavedData extends SavedData {

public void setColorsDirty(int x, int z) {
this.setDirty();
Expand All @@ -164,15 +165,15 @@ index b794c097039f6a3f812dd76df407587594d3ac49..20c1272b381e2eecc814e3547c3daff0
Iterator iterator = this.carriedBy.iterator();

while (iterator.hasNext()) {
@@ -529,6 +555,7 @@ public class MapItemSavedData extends SavedData {
@@ -529,6 +554,7 @@ public class MapItemSavedData extends SavedData {
public void removedFromFrame(BlockPos pos, int id) {
this.removeDecoration(MapItemSavedData.getFrameKey(id));
this.frameMarkers.remove(MapFrame.frameId(pos));
+ this.dirtyFrameDecorations = true; // Paper
}

public boolean updateColor(int x, int z, byte color) {
@@ -590,6 +617,93 @@ public class MapItemSavedData extends SavedData {
@@ -590,6 +616,93 @@ public class MapItemSavedData extends SavedData {
return "frame-" + id;
}

Expand Down

0 comments on commit 6ffcb57

Please sign in to comment.