From 0aa7d1a07f960357d85685aac71373b41471f8a2 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Sun, 23 Oct 2022 09:09:18 -0700
Subject: [PATCH] Mark chunks as saved after saving them

Prevents re-saving them again later.
---
 patches/server/Rewrite-chunk-system.patch | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/patches/server/Rewrite-chunk-system.patch b/patches/server/Rewrite-chunk-system.patch
index c50defa2c6..cc7a1e39db 100644
--- a/patches/server/Rewrite-chunk-system.patch
+++ b/patches/server/Rewrite-chunk-system.patch
@@ -10845,6 +10845,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +
 +                    task.queue();
 +
++                    chunk.setUnsaved(false);
++
 +                    return true;
 +                } catch (final ThreadDeath death) {
 +                    throw death;
@@ -10863,6 +10865,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
 +            } else {
 +                RegionFileIOThread.scheduleSave(this.world, this.chunkX, this.chunkZ, save, RegionFileIOThread.RegionFileType.CHUNK_DATA);
 +            }
++            chunk.setUnsaved(false);
 +        } catch (final ThreadDeath death) {
 +            throw death;
 +        } catch (final Throwable thr) {