Fix RegionFileCache write logic

This commit is contained in:
Shane Freeder
2019-05-07 16:26:37 +01:00
parent e052a9deff
commit aa5d287e4f
3 changed files with 12 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Chunk Save Reattempt
We commonly have "Stream Closed" errors on chunk saving, so this code should re-try to save the chunk in the event of failure and hopefully prevent rollbacks.
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 88b5aa3a51..b062a31c49 100644
index 88b5aa3a5..b062a31c4 100644
--- a/src/main/java/net/minecraft/server/RegionFile.java
+++ b/src/main/java/net/minecraft/server/RegionFile.java
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
@@ -20,7 +20,7 @@ index 88b5aa3a51..b062a31c49 100644
}
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
index ad76ed27dc..75731c9195 100644
index ad76ed27d..20f563144 100644
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
@@ -35,6 +35,8 @@ index ad76ed27dc..75731c9195 100644
}
+ // Paper start
+ return;
+ } catch (Exception ex) {
+ laste = ex;
+ }
@@ -44,6 +46,7 @@ index ad76ed27dc..75731c9195 100644
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste);
+ MinecraftServer.LOGGER.error("Failed to save chunk", laste);
+ }
+ // Paper end
}
public void close() throws IOException {