More 1.14 patches

now we can rebase
This commit is contained in:
Spottedleaf
2019-05-05 10:19:34 -07:00
parent 70e4947867
commit 670fbcd29e
41 changed files with 527 additions and 673 deletions

View File

@@ -15,45 +15,47 @@ 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..369aaa84c4 100644
index 6893f3cd34..717b0b1f08 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 {
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
private static NBTTagCompound readOversizedChunk(RegionFile regionfile, ChunkCoordIntPair chunkCoordinate) throws IOException {
synchronized (regionfile) {
try (DataInputStream datainputstream = regionfile.getReadStream(i & 31, j & 31)) {
- NBTTagCompound oversizedData = regionfile.getOversizedData(i, j);
try (DataInputStream datainputstream = regionfile.getReadStream(chunkCoordinate)) {
- NBTTagCompound oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
- 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);
+ oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
+ } catch (Exception ex) {}
+
+ NBTTagCompound chunk;
+
+ try {
+ chunk = NBTCompressedStreamTools.readNBT(datainputstream);
+ } catch (Exception ex) {
+ chunk = NBTCompressedStreamTools.readNBT(datainputstream);
+ } catch (final Exception ex) {
+ return null;
+ }
+ // Paper end
if (oversizedData == null) {
return chunk;
}
@@ -0,0 +0,0 @@ public class RegionFileCache {
return null;
}
@@ -0,0 +0,0 @@ public abstract class RegionFileCache implements AutoCloseable {
- return NBTCompressedStreamTools.a(datainputstream);
+ // Paper start - Handle bad chunks more gracefully
+ try {
+ return NBTCompressedStreamTools.a(datainputstream);
+ } catch (Exception ex) {
+ return null;
+ }
+ // Paper end
}
try {
if (datainputstream != null) {
- nbttagcompound = NBTCompressedStreamTools.a(datainputstream);
- return nbttagcompound;
+ // Paper start - Handle bad chunks more gracefully
+ try {
+ return NBTCompressedStreamTools.a(datainputstream);
+ } catch (Exception ex) {
+ return null;
+ }
+ // Paper end
}
@Nullable
nbttagcompound = null;
--