keepcalm / BukkitForge

The world's first __opensource__ coremod. Also a port of the Bukkit server API to MinecraftForge.
http://www.minecraftforge.net/forum/index.php/topic,3254.0.html
103 stars 60 forks source link

NullPointerException at CraftChunk (line 198) - getChunkSnapshot #564

Open MoonStorm opened 11 years ago

MoonStorm commented 11 years ago

I get this every time I'm attempting to call getChunkSnapshot(true, true, false).

dequis commented 11 years ago

Full error please, no idea what you're talking about without context. Does that affect an existing plugin, or is it an api issue you've found while developing your own?

MoonStorm commented 11 years ago

Full error you say. Is this more clear: "NullPointerException at org.bukkit.craftbukkit.CraftChunk.getChunkSnapshot(CraftChunk.java:198)"? :)

To put it into context, this is indeed affecting my own plugin. People have been complaining about my plugin failing to work in Tekkit Lite with Bukkit Forge so I grabbed Tekkit Lite 0.5.7 and the latest version of Bukkit Forge from the Jenkins CI, so straight from the oven, and the plugin was indeed constantly breaking when attempting to call the aforementioned method. Checked one of the chunks, in the debugger, and the chunk was reported as loaded and populated. Same code works fine in CB vanilla, not to mention a couple of other flavors.

dequis commented 11 years ago

Well actually I was looking for a stack trace, mostly because they help identifying what plugin called the method and how, but if you're calling it directly then that's good enough I guess.

We can't try to reproduce it (and fix it) unless we have a plugin that does the same, so, if you're feeling helpful post a minimal test case that does only this. (We could write it ourselves too, but pretty much the only active dev right now is spoons and we don't want to waste his limited time - so yeah. test cases are appreciated)

MoonStorm commented 11 years ago

Here is a simple test plugin replicating the problem (source included). It's hooked up to the player interact event, so by right clicking any block in the world you'll notice the exception being thrown.

https://s3.amazonaws.com/bukkitforgebug/BukkitForgeBug.zip

MoonStorm commented 11 years ago

Any updates on this one?