/* * To be called by the server at the appropriate time, do not call from mod code. */ public static void unloadWorlds(Hashtable<Integer, long[]> worldTickTimes) { for (int id : unloadQueue) { WorldServer w = worlds.get(id); try { if (w != null) { w.saveAllChunks(true, null); } else { FMLLog.warning("Unexpected world unload - world %d is already unloaded", id); } } catch (MinecraftException e) { e.printStackTrace(); } finally { if (w != null) { MinecraftForge.EVENT_BUS.post(new WorldEvent.Unload(w)); w.flush(); setWorld(id, null); } } } unloadQueue.clear(); }