Fix some runtime issues

This commit is contained in:
Spottedleaf
2019-05-06 13:45:02 -07:00
parent b64ce880b7
commit b372f891aa
8 changed files with 31 additions and 10 deletions

View File

@@ -64,7 +64,7 @@ index b7c94fe238..80eea5dfbd 100644
public NBTTagList() {}
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index e68f901943..995a893774 100644
index e68f901943..ed2ccebb23 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 {
@@ -77,6 +77,14 @@ index e68f901943..995a893774 100644
private static final byte[] a = new byte[4096];
private final RandomAccessFile b; private RandomAccessFile getDataFile() { return this.b; } // Paper - OBFHELPER
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
public RegionFile(File file) throws IOException {
this.b = new RandomAccessFile(file, "rw");
+ this.file = file; // Spigot // Paper - We need this earlier
if (this.b.length() < 8192L) { // Paper - headers should be 8192
this.b.write(RegionFile.a);
this.b.write(RegionFile.a);
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
}
header.clear();
java.nio.IntBuffer headerAsInts = header.asIntBuffer();
@@ -94,6 +102,11 @@ index e68f901943..995a893774 100644
// Spigot end
this.e.set((k >> 8) + l, false);
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
if (offsets[j] != 0) this.timestamps[j] = k; // Paper - don't set timestamp if it got 0'd above due to corruption
}
- this.file = file; // Spigot
+ // Paper - we need this earlier
}
@Nullable