mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-12 00:07:33 +00:00
NPE check on onChunkUnload (#51)
This commit is contained in:
1 parent
a385d29ab3
commit
b738e8e073
1 file changed
+4
-1
@@ -55,7 +55,10 @@ public class WorldExtensionManager {
|
||||
public void onChunkUnLoad(ChunkEvent.Unload event) {
|
||||
if (event.getChunk() instanceof EmptyChunk) return;
|
||||
|
||||
for (WorldExtension extension : worldMap.get(event.world)) extension.unloadChunk(event.getChunk());
|
||||
WorldExtension[] extensions = worldMap.get(event.world);
|
||||
if (extensions == null) return;
|
||||
|
||||
for (WorldExtension extension : extensions) extension.unloadChunk(event.getChunk());
|
||||
|
||||
if (event.world.isRemote) removeChunk(event.world, event.getChunk());
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user