pocketmine\Server::unloadLevel PHP Method

unloadLevel() public method

public unloadLevel ( Level $level, boolean $forceUnload = false ) : boolean
$level pocketmine\level\Level
$forceUnload boolean
return boolean
    public function unloadLevel(Level $level, $forceUnload = false)
    {
        if ($level === $this->getDefaultLevel() and !$forceUnload) {
            throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels.");
        }
        if ($level->unload($forceUnload) === true) {
            unset($this->levels[$level->getId()]);
            return true;
        }
        return false;
    }
Server