9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-19 15:09:25 +00:00
Files
Leaf/leaf-archived-patches/removed/1.21.5/mcserver/0280-Paper-Fix-infinite-loop-in-RegionFile-IO.patch
2025-06-29 23:39:55 +08:00

30 lines
1.4 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
Date: Mon, 9 Jun 2025 02:46:34 -0700
Subject: [PATCH] Paper: Fix infinite loop in RegionFile IO
Removed since Leaf 1.21.5/Paper 1.21.4, added on Paper
Original license: GPLv3
Original project: https://github.com/PaperMC/Paper
https://github.com/PaperMC/Paper/commit/519e4224b1ba73a99c58c8fc53aab003eb6af37a
If an exception is thrown during decompress then the read process
would be started again, which of course would eventually throw in
the decompress process.
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
index 709df35246fb328cda21679b53d44d9f96206cb3..8c2520cdea0a67eae6fa57ccb4cae660bdea5da9 100644
--- a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
@@ -1143,7 +1143,7 @@ public final class MoonriseRegionFileIO {
LOGGER.error("Failed to decompress chunk data for task: " + this.toString(), thr);
}
- if (compoundTag == null) {
+ if (throwable == null && compoundTag == null) { // Paper - Fix infinite loop in RegionFile IO
// need to re-try from the start
this.scheduleReadIO();
return;