diff options
author | Mike Primm <mike@primmhome.com> | 2012-12-20 14:05:07 -0600 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-12-20 14:22:25 -0600 |
commit | ed2dd31a80a429b1da1221a30b8acceff54ff951 (patch) | |
tree | 8947741f8b3013c566bc0925931452f1ca636260 /src/main/java | |
parent | 686807e387f47869c60983301050caaa069a7a82 (diff) | |
download | craftbukkit-ed2dd31a80a429b1da1221a30b8acceff54ff951.tar craftbukkit-ed2dd31a80a429b1da1221a30b8acceff54ff951.tar.gz craftbukkit-ed2dd31a80a429b1da1221a30b8acceff54ff951.tar.lz craftbukkit-ed2dd31a80a429b1da1221a30b8acceff54ff951.tar.xz craftbukkit-ed2dd31a80a429b1da1221a30b8acceff54ff951.zip |
[Bleeding] Fix exception in getChunkSnapshot() - sky light can be null
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index 32c808be..c3b9113a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -193,8 +193,12 @@ public class CraftChunk implements Chunk { /* Get block data nibbles */ sectionBlockData[i] = new byte[2048]; System.arraycopy(cs[i].j().a, 0, sectionBlockData[i], 0, 2048); // Should be getData - sectionSkyLights[i] = new byte[2048]; - System.arraycopy(cs[i].l().a, 0, sectionSkyLights[i], 0, 2048); // Should be getSkyLight + if (cs[i].l() == null) { + sectionSkyLights[i] = emptyData; + } else { + sectionSkyLights[i] = new byte[2048]; + System.arraycopy(cs[i].l().a, 0, sectionSkyLights[i], 0, 2048); // Should be getSkyLight + } sectionEmitLights[i] = new byte[2048]; System.arraycopy(cs[i].k().a, 0, sectionEmitLights[i], 0, 2048); // Should be getBlockLight } |