mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-18 21:20:24 -07:00
Fix unnecessary map data saves (#12296)
This commit is contained in:
parent
1e930763d2
commit
646b80ca53
@ -96,6 +96,20 @@
|
||||
}
|
||||
|
||||
public static void addTargetDecoration(ItemStack stack, BlockPos pos, String type, Holder<MapDecorationType> mapDecorationType) {
|
||||
@@ -354,7 +_,12 @@
|
||||
}
|
||||
|
||||
public void setColorsDirty(int x, int z) {
|
||||
- this.setDirty();
|
||||
+ // Paper start - Fix unnecessary map data saves
|
||||
+ this.setColorsDirty(x, z, true);
|
||||
+ }
|
||||
+ public void setColorsDirty(int x, int z, boolean markFileDirty) {
|
||||
+ if (markFileDirty) this.setDirty();
|
||||
+ // Paper end - Fix unnecessary map data saves
|
||||
|
||||
for (MapItemSavedData.HoldingPlayer holdingPlayer : this.carriedBy) {
|
||||
holdingPlayer.markColorsDirty(x, z);
|
||||
@@ -395,7 +_,7 @@
|
||||
return true;
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class CraftMapCanvas implements MapCanvas {
|
||||
return;
|
||||
if (this.buffer[y * 128 + x] != color) {
|
||||
this.buffer[y * 128 + x] = color;
|
||||
this.mapView.worldMap.setColorsDirty(x, y);
|
||||
this.mapView.worldMap.setColorsDirty(x, y, false); // Paper - Fix unnecessary map data saves
|
||||
}
|
||||
}
|
||||
|
||||
@ -141,8 +141,8 @@ public class CraftMapCanvas implements MapCanvas {
|
||||
}
|
||||
|
||||
// Mark all colors within the image as dirty
|
||||
this.mapView.worldMap.setColorsDirty(destX, destY);
|
||||
this.mapView.worldMap.setColorsDirty(destX + effectiveWidth - 1, destY + effectiveHeight - 1);
|
||||
this.mapView.worldMap.setColorsDirty(destX, destY, false);
|
||||
this.mapView.worldMap.setColorsDirty(destX + effectiveWidth - 1, destY + effectiveHeight - 1, false);
|
||||
// Paper end
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user