Done world load a bit more safer

This commit is contained in:
Sotr
2018-07-28 02:57:20 +08:00
parent f2c15275e9
commit 1641f2767f

View File

@@ -119,10 +119,18 @@ public abstract class MixinMinecraftServer {
executor.submit(() -> prepareChunks(world, fIndex), null);
}
if (WorldLoadEvent.getHandlerList().getRegisteredListeners().length == 0) {
for (WorldServer world : this.worlds) {
if (world.getWorld().getKeepSpawnInMemory()) executor.take();
}
} else {
for (WorldServer world : this.worlds) {
if (world.getWorld().getKeepSpawnInMemory()) executor.take();
}
for (WorldServer world : this.worlds) {
this.server.getPluginManager().callEvent(new WorldLoadEvent(world.getWorld()));
}
}
enablePluginsPostWorld();
}