Fix infinite loop in RegionFile IO

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.
This commit is contained in:
Spottedleaf
2025-06-09 03:04:38 -07:00
parent c63166f35c
commit 6101c8af5b

View File

@@ -1137,7 +1137,7 @@ index 0000000000000000000000000000000000000000..a814512fcfb85312474ae2c2c2144384
+}
diff --git a/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
new file mode 100644
index 0000000000000000000000000000000000000000..1acea58838f057ab87efd103cbecb6f5aeaef393
index 0000000000000000000000000000000000000000..25bceb88f7d040034a740c18ed5a3aab50b0c72b
--- /dev/null
+++ b/ca/spottedleaf/moonrise/patches/chunk_system/io/MoonriseRegionFileIO.java
@@ -0,0 +1,1700 @@
@@ -2286,7 +2286,7 @@ index 0000000000000000000000000000000000000000..1acea58838f057ab87efd103cbecb6f5
+ LOGGER.error("Failed to decompress chunk data for task: " + this.toString(), thr);
+ }
+
+ if (compoundTag == null) {
+ if (throwable == null && compoundTag == null) {
+ // need to re-try from the start
+ this.scheduleReadIO();
+ return;
@@ -28633,7 +28633,7 @@ index 8cc5c0716392ba06501542ff5cbe71ee43979e5d..09fd99c9cbd23b5f3c899bfb00c9b896
+ // Paper end - block counting
}
diff --git a/net/minecraft/world/entity/Entity.java b/net/minecraft/world/entity/Entity.java
index a97de8eddd764e628d0f3866c5d1e99e6dae5f6e..503ac3a16c8490d7a620d43b12c4f0c80565615a 100644
index 034fd1ae8a5f46df250a86058a6583d52dd5c70a..af5b95978ea0b2afa4a1cd7aad99b75a9b1ef374 100644
--- a/net/minecraft/world/entity/Entity.java
+++ b/net/minecraft/world/entity/Entity.java
@@ -147,7 +147,7 @@ import net.minecraft.world.waypoints.WaypointTransmitter;