Only write to cached header in RegionFile if write potentially succeeds (#2294)

This commit is contained in:
Spottedleaf
2019-07-21 14:36:27 -07:00
parent 6b80069cbe
commit 61b8600730
2 changed files with 21 additions and 8 deletions

View File

@@ -197,7 +197,7 @@ index 0911880c9d..86fb51b90a 100644
boolean isOutsideOfRange(ChunkCoordIntPair chunkcoordintpair) {
// Spigot start
diff --git a/src/main/java/net/minecraft/server/RegionFile.java b/src/main/java/net/minecraft/server/RegionFile.java
index 2e14d84657..66c8b0307f 100644
index b0ec9edf67..41f1e15cb0 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 {
@@ -240,7 +240,7 @@ index 2e14d84657..66c8b0307f 100644
return this.getOffset(chunkcoordintpair) != 0;
}
@@ -0,0 +0,0 @@ public class RegionFile implements AutoCloseable {
this.writeInt(i); // Paper - Avoid 3 io write calls
this.c[j] = i; // Paper - move this to after the write
}
+ private final int getChunkLocation(ChunkCoordIntPair chunkcoordintpair) { return this.f(chunkcoordintpair); } // Paper - OBFHELPER