summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2015-03-15 21:38:05 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2015-03-15 21:38:05 +0000
commit7f609b12b9d82186852052973d1a11e90eb78ad0 (patch)
treec5545aa81dbeca32c854a65847c7b69ce93562c8 /src
parent6a374be73752b0d6317ac6e1dfdf1cea312cbacd (diff)
downloadcraftbukkit-7f609b12b9d82186852052973d1a11e90eb78ad0.tar
craftbukkit-7f609b12b9d82186852052973d1a11e90eb78ad0.tar.gz
craftbukkit-7f609b12b9d82186852052973d1a11e90eb78ad0.tar.lz
craftbukkit-7f609b12b9d82186852052973d1a11e90eb78ad0.tar.xz
craftbukkit-7f609b12b9d82186852052973d1a11e90eb78ad0.zip
SPIGOT-705: Fix possible CME
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
index 5b568989..0f445dfc 100644
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
@@ -12,6 +12,8 @@ import org.bukkit.craftbukkit.util.LongHash;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import java.util.logging.Logger;
+import net.minecraft.server.Entity;
+import net.minecraft.server.EntitySlice;
class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChunk, Chunk, Runnable, RuntimeException> {
private final AtomicInteger threadNumber = new AtomicInteger(1);
@@ -40,6 +42,10 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
queuedChunk.provider.originalGetChunkAt(queuedChunk.x, queuedChunk.z);
return;
}
+ // moved from Chunk.<init>
+ for (int k = 0; k < chunk.entitySlices.length; ++k) {
+ chunk.entitySlices[k] = new EntitySlice(Entity.class);
+ }
queuedChunk.loader.loadEntities(chunk, queuedChunk.compound.getCompound("Level"), queuedChunk.world);
chunk.setLastSaved(queuedChunk.provider.world.getTime());