mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
93e9b2fa4e
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 5b680f0b Note maximum objective score length in documentation CraftBukkit Changes:5932f8a7
Load default world spawn areas in consistent order3a5dc78f
Fix confusing migration message appearing on fresh server516a408f
Remove redundant CraftBukkit change for secondary world data73a2c749
Process conversation input on the main thread.100c3f07
Cap Objective Score Length6e842759
Cross World Entity Teleportation7deba1c6
Check for blank OfflinePlayer Namesf2746a5e
Descriptive kick reasons instead of Nope!b0212308
Cap Channel Registrationsa610dcd8
Identify CraftScheduler threads with useful names Spigot Changes: 19c3c5a5 Rebuild patches
56 lines
No EOL
2.5 KiB
Diff
56 lines
No EOL
2.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Mon, 4 Mar 2013 23:46:10 -0500
|
|
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 5b48bb0b7..ecb9c4e0f 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 {
|
|
|
|
this.b(i, j, (int) (SystemUtils.getTimeMillis() / 1000L));
|
|
} catch (IOException ioexception) {
|
|
- ioexception.printStackTrace();
|
|
- ServerInternalException.reportInternalException(ioexception); // Paper
|
|
+ com.destroystokyo.paper.util.SneakyThrow.sneaky(ioexception); // Paper - we want the upper try/catch to retry this
|
|
}
|
|
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java
|
|
index e507a996f..5dbd1d517 100644
|
|
--- a/src/main/java/net/minecraft/server/RegionFileCache.java
|
|
+++ b/src/main/java/net/minecraft/server/RegionFileCache.java
|
|
@@ -0,0 +0,0 @@ public class RegionFileCache {
|
|
|
|
@Nullable
|
|
public static synchronized void write(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException {
|
|
+ int attempts = 0; Exception laste = null; while (attempts++ < 5) { try { // Paper
|
|
RegionFile regionfile = a(file, i, j);
|
|
|
|
DataOutputStream dataoutputstream = regionfile.c(i & 31, j & 31);
|
|
NBTCompressedStreamTools.a(nbttagcompound, (java.io.DataOutput) dataoutputstream);
|
|
dataoutputstream.close();
|
|
+ // Paper start
|
|
+ laste = null; break; // Paper
|
|
+ } catch (Exception exception) {
|
|
+ //ChunkRegionLoader.a.error("Failed to save chunk", exception); // Paper
|
|
+ laste = exception; // Paper
|
|
+ }
|
|
+ try {
|
|
+ Thread.sleep(10);
|
|
+ } catch (InterruptedException e) {
|
|
+ e.printStackTrace();
|
|
+ }
|
|
+ }
|
|
+ if (laste != null) {
|
|
+ com.destroystokyo.paper.exception.ServerInternalException.reportInternalException(laste);
|
|
+ MinecraftServer.LOGGER.error("Failed to save chunk", laste);
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
|
|
public static synchronized boolean chunkExists(File file, int i, int j) {
|
|
--
|