mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 19:28:03 +01:00
Don't try to read the data outside of the try-catch
This commit is contained in:
parent
1a74c62cf3
commit
9cc93b1229
1 changed files with 4 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue