From 8544aa17eea214363bb441f86215a2080ab05c11 Mon Sep 17 00:00:00 2001 From: SenseiKiwi Date: Sun, 13 Jul 2014 14:22:23 -0400 Subject: [PATCH] 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. --- .../StevenDimDoors/mod_pocketDim/EventHookContainer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/StevenDimDoors/mod_pocketDim/EventHookContainer.java b/src/main/java/StevenDimDoors/mod_pocketDim/EventHookContainer.java index 9fd2d418..e40d7c2b 100644 --- a/src/main/java/StevenDimDoors/mod_pocketDim/EventHookContainer.java +++ b/src/main/java/StevenDimDoors/mod_pocketDim/EventHookContainer.java @@ -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))