Fixed Crash on World Creation

Fixed an issue. DD would crash when MC created a completely new world
because onChunkLoad() would be called before onWorldLoad(). That's not
the usual order. PocketManager would be unloaded at that point and would
return a null dimension.
This commit is contained in:
SenseiKiwi 2014-07-13 14:22:23 -04:00
parent b20a0a74d2
commit 8544aa17ee

View file

@ -230,8 +230,11 @@ public class EventHookContainer
{
// Schedule rift regeneration for any links located in this chunk.
// This event runs on both the client and server. Allow server only.
// Also, check that PocketManager is loaded, because onChunkLoad() can
// fire while chunks are being initialized in a new world, before
// onWorldLoad() fires.
Chunk chunk = event.getChunk();
if (!chunk.worldObj.isRemote)
if (!chunk.worldObj.isRemote && PocketManager.isLoaded())
{
NewDimData dimension = PocketManager.getDimensionData(chunk.worldObj);
for (DimLink link : dimension.getChunkLinks(chunk.xPosition, chunk.zPosition))