@Override public void run() { try { server.stop(); } catch (ExceptionWorldConflict ex) { ex.printStackTrace(); } finally { try { server.reader.getTerminal().restore(); } catch (Exception e) { } } }
@Override public boolean unloadWorld(World world, boolean save) { if (world == null) { return false; } WorldServer handle = ((CraftWorld) world).getHandle(); if (!(console.worlds.contains(handle))) { return false; } if (!(handle.dimension > 1)) { return false; } if (handle.players.size() > 0) { return false; } WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld()); pluginManager.callEvent(e); if (e.isCancelled()) { return false; } if (save) { try { handle.save(true, null); handle.saveLevel(); WorldSaveEvent event = new WorldSaveEvent(handle.getWorld()); getPluginManager().callEvent(event); } catch (ExceptionWorldConflict ex) { getLogger().log(Level.SEVERE, null, ex); } } worlds.remove(world.getName().toLowerCase()); console.worlds.remove(console.worlds.indexOf(handle)); return true; }
public boolean unloadWorld(World world, boolean save) { if (world == null) { return false; } WorldServer handle = ((CraftWorld) world).getHandle(); if (!(console.worlds.contains(handle))) { return false; } if (!(handle.dimension > 1)) { return false; } if (handle.players.size() > 0) { return false; } WorldUnloadEvent e = new WorldUnloadEvent(handle.getWorld()); pluginManager.callEvent(e); if (e.isCancelled()) { return false; } if (save) { try { handle.save(true, null); handle.saveLevel(); WorldSaveEvent event = new WorldSaveEvent(handle.getWorld()); getPluginManager().callEvent(event); } catch (ExceptionWorldConflict ex) { getLogger().log(Level.SEVERE, null, ex); } } worlds.remove(world.getName().toLowerCase()); console.worlds.remove(console.worlds.indexOf(handle)); return true; }