From 9cc93b1229de0945aa63f32a402894471148846b Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Mon, 15 Apr 2019 05:06:43 +0100 Subject: [PATCH] Don't try to read the data outside of the try-catch --- .../Handle-bad-chunks-more-gracefully.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch b/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch index f6e68accb..74fb6efbb 100644 --- a/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch +++ b/Spigot-Server-Patches/Handle-bad-chunks-more-gracefully.patch @@ -15,16 +15,17 @@ Should Mojang choose to alter this behavior in the future, this change will simply defer to whatever that new behavior is. diff --git a/src/main/java/net/minecraft/server/RegionFileCache.java b/src/main/java/net/minecraft/server/RegionFileCache.java -index 17e76815ad..2eb7888027 100644 +index 17e76815ad..369aaa84c4 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 { private static NBTTagCompound readOversizedChunk(RegionFile regionfile, int i, int j) throws IOException { synchronized (regionfile) { try (DataInputStream datainputstream = regionfile.getReadStream(i & 31, j & 31)) { -+ // Paper start - Handle bad chunks more gracefully - also handle similarly with oversized data - NBTTagCompound oversizedData = regionfile.getOversizedData(i, j); +- NBTTagCompound oversizedData = regionfile.getOversizedData(i, j); - NBTTagCompound chunk = NBTCompressedStreamTools.readNBT(datainputstream); ++ // Paper start - Handle bad chunks more gracefully - also handle similarly with oversized data ++ NBTTagCompound oversizedData = null; + + try { + oversizedData = regionfile.getOversizedData(i, j);