From 61fb069c616f7a7ce25a4b37d68b93930ef5c8cf Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Fri, 2 Mar 2012 20:12:53 +0000 Subject: [PATCH] Fixed fatal crashes when there's a block at maxheight at spawn - this fixes BUKKIT-922. --- src/main/java/net/minecraft/server/Chunk.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java index 34887c3927..ab006bbec0 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -330,12 +330,14 @@ public class Chunk { } public int getTypeId(int i, int j, int k) { + if (j >> 4 >= sections.length) return 0; ChunkSection chunksection = this.sections[j >> 4]; return chunksection != null ? chunksection.a(i, j & 15, k) : 0; } public int getData(int i, int j, int k) { + if (j >> 4 >= sections.length) return 0; ChunkSection chunksection = this.sections[j >> 4]; return chunksection != null ? chunksection.b(i, j & 15, k) : 0;