From 94662dd73f64b95b00f608c56d39928ac80bdabd Mon Sep 17 00:00:00 2001 From: Prototik Date: Thu, 28 May 2015 21:21:56 +0700 Subject: [PATCH] Avoid NPE during chunk profiling --- patches/net/minecraft/world/World.java.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/net/minecraft/world/World.java.patch b/patches/net/minecraft/world/World.java.patch index 1a20f1a..f2a429d 100644 --- a/patches/net/minecraft/world/World.java.patch +++ b/patches/net/minecraft/world/World.java.patch @@ -573,6 +573,15 @@ if (p_72805_1_ >= -30000000 && p_72805_3_ >= -30000000 && p_72805_1_ < 30000000 && p_72805_3_ < 30000000) { if (p_72805_2_ < 0) +@@ -511,7 +892,7 @@ + Chunk chunk = this.getChunkFromChunkCoords(p_72805_1_ >> 4, p_72805_3_ >> 4); + p_72805_1_ &= 15; + p_72805_3_ &= 15; +- return chunk.getBlockMetadata(p_72805_1_, p_72805_2_, p_72805_3_); ++ return chunk == null ? 0 : chunk.getBlockMetadata(p_72805_1_, p_72805_2_, p_72805_3_); + } + } + else @@ -610,6 +991,12 @@ public void notifyBlockChange(int p_147444_1_, int p_147444_2_, int p_147444_3_, Block p_147444_4_)