2016-06-12 11:28:27 +02:00
|
|
|
--- a/net/minecraft/server/RegionFileCache.java
|
|
|
|
+++ b/net/minecraft/server/RegionFileCache.java
|
2017-02-01 00:52:21 +01:00
|
|
|
@@ -74,19 +74,29 @@
|
2016-06-12 11:28:27 +02:00
|
|
|
RegionFileCache.a.clear();
|
|
|
|
}
|
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
- public static DataInputStream d(File file, int i, int j) {
|
2016-06-12 11:28:27 +02:00
|
|
|
+ // CraftBukkit start - call sites hoisted for synchronization
|
2016-11-17 02:41:03 +01:00
|
|
|
+ public static synchronized NBTTagCompound d(File file, int i, int j) throws IOException {
|
2016-06-12 11:28:27 +02:00
|
|
|
RegionFile regionfile = a(file, i, j);
|
|
|
|
|
|
|
|
- return regionfile.a(i & 31, j & 31);
|
|
|
|
+ DataInputStream datainputstream = regionfile.a(i & 31, j & 31);
|
|
|
|
+
|
|
|
|
+ if (datainputstream == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return NBTCompressedStreamTools.a(datainputstream);
|
|
|
|
}
|
|
|
|
|
2016-11-17 02:41:03 +01:00
|
|
|
- public static DataOutputStream e(File file, int i, int j) {
|
|
|
|
+ public static synchronized void e(File file, int i, int j, NBTTagCompound nbttagcompound) throws IOException {
|
2016-06-12 11:28:27 +02:00
|
|
|
RegionFile regionfile = a(file, i, j);
|
|
|
|
|
|
|
|
- return regionfile.b(i & 31, j & 31);
|
|
|
|
+ DataOutputStream dataoutputstream = regionfile.b(i & 31, j & 31);
|
|
|
|
+ NBTCompressedStreamTools.a(nbttagcompound, (java.io.DataOutput) dataoutputstream);
|
|
|
|
+ dataoutputstream.close();
|
|
|
|
}
|
|
|
|
+ // CraftBukkit end
|
2016-11-17 02:41:03 +01:00
|
|
|
|
2017-02-01 00:52:21 +01:00
|
|
|
- public static boolean f(File file, int i, int j) {
|
|
|
|
+ public static synchronized boolean f(File file, int i, int j) { // PAIL chunkExists; CraftBukkit
|
2016-11-17 02:41:03 +01:00
|
|
|
RegionFile regionfile = b(file, i, j);
|
2017-02-01 00:52:21 +01:00
|
|
|
|
|
|
|
return regionfile != null ? regionfile.c(i & 31, j & 31) : false;
|