summaryrefslogtreecommitdiffstats
path: root/nms-patches/ChunkRegionLoader.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-05-10 21:47:39 +1000
committermd_5 <git@md-5.net>2016-05-10 21:47:39 +1000
commitc5e9a169fa564f3b8119b6666f8df59d5a9b45c3 (patch)
tree9f3b1ce732f0082b71512b1dddb7abb35526226e /nms-patches/ChunkRegionLoader.patch
parent4cb32587ac1ff543b2efa9498f8d0d358cb90c12 (diff)
downloadcraftbukkit-c5e9a169fa564f3b8119b6666f8df59d5a9b45c3.tar
craftbukkit-c5e9a169fa564f3b8119b6666f8df59d5a9b45c3.tar.gz
craftbukkit-c5e9a169fa564f3b8119b6666f8df59d5a9b45c3.tar.lz
craftbukkit-c5e9a169fa564f3b8119b6666f8df59d5a9b45c3.tar.xz
craftbukkit-c5e9a169fa564f3b8119b6666f8df59d5a9b45c3.zip
Minecraft 1.9.4
Diffstat (limited to 'nms-patches/ChunkRegionLoader.patch')
-rw-r--r--nms-patches/ChunkRegionLoader.patch17
1 files changed, 9 insertions, 8 deletions
diff --git a/nms-patches/ChunkRegionLoader.patch b/nms-patches/ChunkRegionLoader.patch
index 44998f47..309445cd 100644
--- a/nms-patches/ChunkRegionLoader.patch
+++ b/nms-patches/ChunkRegionLoader.patch
@@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkRegionLoader.java
+++ b/net/minecraft/server/ChunkRegionLoader.java
-@@ -28,7 +28,35 @@
+@@ -29,8 +29,36 @@
this.e = dataconvertermanager;
}
@@ -19,6 +19,7 @@
+ // CraftBukkit end
+
+ // CraftBukkit start - Add async variant, provide compatibility
+ @Nullable
public Chunk a(World world, int i, int j) throws IOException {
+ Object[] data = loadChunk(world, i, j);
+ if (data != null) {
@@ -36,7 +37,7 @@
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
NBTTagCompound nbttagcompound = (NBTTagCompound) this.b.get(chunkcoordintpair);
-@@ -45,7 +73,7 @@
+@@ -47,7 +75,7 @@
return this.a(world, i, j, nbttagcompound);
}
@@ -45,7 +46,7 @@
if (!nbttagcompound.hasKeyOfType("Level", 10)) {
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is missing level data, skipping");
return null;
-@@ -62,10 +90,28 @@
+@@ -64,10 +92,28 @@
ChunkRegionLoader.a.error("Chunk file at " + i + "," + j + " is in the wrong location; relocating. (Expected " + i + ", " + j + ", got " + chunk.locX + ", " + chunk.locZ + ")");
nbttagcompound1.setInt("xPos", i);
nbttagcompound1.setInt("zPos", j);
@@ -75,7 +76,7 @@
}
}
}
-@@ -295,6 +341,13 @@
+@@ -296,6 +342,13 @@
chunk.a(nbttagcompound.getByteArray("Biomes"));
}
@@ -89,7 +90,7 @@
NBTTagList nbttaglist1 = nbttagcompound.getList("Entities", 10);
if (nbttaglist1 != null) {
-@@ -338,7 +391,7 @@
+@@ -339,7 +392,7 @@
}
}
@@ -97,8 +98,8 @@
+ // return chunk; // CraftBukkit
}
- public static Entity a(NBTTagCompound nbttagcompound, World world, Chunk chunk) {
-@@ -399,8 +452,14 @@
+ @Nullable
+@@ -403,8 +456,14 @@
}
}
@@ -111,6 +112,6 @@
+ public static void a(Entity entity, World world, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason reason) {
+ if (world.addEntity(entity, reason) && entity.isVehicle()) {
+ // CraftBukkit end
- Iterator iterator = entity.bu().iterator();
+ Iterator iterator = entity.bv().iterator();
while (iterator.hasNext()) {