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:
parent
b20a0a74d2
commit
8544aa17ee
1 changed files with 4 additions and 1 deletions
|
@ -230,8 +230,11 @@ public class EventHookContainer
|
||||||
{
|
{
|
||||||
// Schedule rift regeneration for any links located in this chunk.
|
// Schedule rift regeneration for any links located in this chunk.
|
||||||
// This event runs on both the client and server. Allow server only.
|
// 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();
|
Chunk chunk = event.getChunk();
|
||||||
if (!chunk.worldObj.isRemote)
|
if (!chunk.worldObj.isRemote && PocketManager.isLoaded())
|
||||||
{
|
{
|
||||||
NewDimData dimension = PocketManager.getDimensionData(chunk.worldObj);
|
NewDimData dimension = PocketManager.getDimensionData(chunk.worldObj);
|
||||||
for (DimLink link : dimension.getChunkLinks(chunk.xPosition, chunk.zPosition))
|
for (DimLink link : dimension.getChunkLinks(chunk.xPosition, chunk.zPosition))
|
||||||
|
|
Loading…
Reference in a new issue