Remove chunk save reattempt patch

This patch does not appear to be doing anything useful, and may
hide errors.

Currently, the save logic does not run through this path either
so it did not do anything.

Additionally, properly implement support for handling
RegionFileSizeException in Moonrise.
This commit is contained in:
Spottedleaf
2024-11-28 17:39:40 -08:00
parent c8457716c4
commit b37a391c02
5 changed files with 381 additions and 409 deletions

View File

@@ -2045,15 +2045,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ try {
+ writeData = this.regionDataController.startWrite(this.chunkX, this.chunkZ, write);
+ } catch (final Throwable thr) {
+ // TODO implement this?
+ /*if (thr instanceof RegionFileStorage.RegionFileSizeException) {
+ final int maxSize = RegionFile.MAX_CHUNK_SIZE / (1024 * 1024);
+ LOGGER.error("Chunk at (" + this.chunkX + "," + this.chunkZ + ") in '" + WorldUtil.getWorldName(this.world) + "' exceeds max size of " + maxSize + "MiB, it has been deleted from disk.");
+ } else */
+ {
+ failedWrite = thr instanceof IOException;
+ LOGGER.error("Failed to write chunk data for task: " + this.toString(), thr);
+ }
+ failedWrite = thr instanceof IOException;
+ LOGGER.error("Failed to write chunk data for task: " + this.toString(), thr);
+ }
+
+ if (writeData == null) {
@@ -33204,7 +33197,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
- RegionFile regionfile = this.getRegionFile(pos, false); // CraftBukkit
+ public void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { // Paper - public
+ public void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { // Paper - rewrite chunk system - public
+ RegionFile regionfile = this.getRegionFile(pos, nbt == null); // CraftBukkit // Paper - rewrite chunk system
+ // Paper start - rewrite chunk system
+ if (regionfile == null) {
@@ -33212,9 +33205,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return;
+ }
+ // Paper end - rewrite chunk system
// Paper start - Chunk save reattempt
int attempts = 0;
Exception lastException = null;
if (nbt == null) {
regionfile.clear(pos);
@@ -0,0 +0,0 @@ public final class RegionFileStorage implements AutoCloseable {
}