GotoLink/NatureOverhaul — pull request #1 by ScottKillen (2013-09-13 05:30:42+00:00)
Title: Fix for "random" NullPpointerException on tree grow

Vanilla minecraft unsafely fires a block placement event without checking that the block was actually placed. (the very next significant line of code performs the check...only too late)

Rather than fix it, this change safely ignores the exception and prevents a crash.

------

Added `try` clause to safely ignore this vanilla bug:

java.lang.NullPointerException
at net.minecraft.world.chunk.Chunk.func_76592_a(Chunk.java:758)
at net.minecraft.world.World.func_72832_d(World.java:558)
at assets.natureoverhaul.TreeUtils.growTree(TreeUtils.java:314)
at assets.natureoverhaul.NatureOverhaul.grow(NatureOverhaul.java:392)
at assets.natureoverhaul.NatureOverhaul.onUpdateTick(NatureOverhaul.java:169)
at assets.natureoverhaul.NatureOverhaul.tickEnd(NatureOverhaul.java:1060)
at cpw.mods.fml.common.SingleIntervalHandler.tickEnd(SingleIntervalHandler.java:34)
at cpw.mods.fml.common.FMLCommonHandler.tickEnd(FMLCommonHandler.java:141)
at cpw.mods.fml.common.FMLCommonHandler.onPostWorldTick(FMLCommonHandler.java:282)
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:675)
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:585)
at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:175)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482)
at net.minecraft.server.ThreadMinecraftServer.run(SourceFile:582)