mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Fixed crashes when default level is not loaded
This commit is contained in:
@ -347,7 +347,6 @@ namespace pocketmine {
|
|||||||
|
|
||||||
ThreadManager::init();
|
ThreadManager::init();
|
||||||
$server = new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
$server = new Server($autoloader, $logger, \pocketmine\PATH, \pocketmine\DATA, \pocketmine\PLUGIN_PATH);
|
||||||
$server->start();
|
|
||||||
|
|
||||||
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
||||||
if($thread->isRunning()){
|
if($thread->isRunning()){
|
||||||
|
@ -1572,6 +1572,12 @@ class Server{
|
|||||||
|
|
||||||
$this->properties->save();
|
$this->properties->save();
|
||||||
|
|
||||||
|
if(!($this->getDefaultLevel() instanceof Level)){
|
||||||
|
$this->getLogger()->emergency("No default level has been loaded");
|
||||||
|
$this->forceShutdown();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask("pocketmine\\utils\\Cache::cleanup"), $this->getProperty("ticks-per.cache-cleanup", 900), $this->getProperty("ticks-per.cache-cleanup", 900));
|
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask("pocketmine\\utils\\Cache::cleanup"), $this->getProperty("ticks-per.cache-cleanup", 900), $this->getProperty("ticks-per.cache-cleanup", 900));
|
||||||
if($this->getConfigBoolean("auto-save", true) === true and $this->getProperty("ticks-per.autosave", 6000) > 0){
|
if($this->getConfigBoolean("auto-save", true) === true and $this->getProperty("ticks-per.autosave", 6000) > 0){
|
||||||
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask(array($this, "doAutoSave")), $this->getProperty("ticks-per.autosave", 6000), $this->getProperty("ticks-per.autosave", 6000));
|
$this->scheduler->scheduleDelayedRepeatingTask(new CallbackTask(array($this, "doAutoSave")), $this->getProperty("ticks-per.autosave", 6000), $this->getProperty("ticks-per.autosave", 6000));
|
||||||
@ -1583,6 +1589,7 @@ class Server{
|
|||||||
|
|
||||||
$this->enablePlugins(PluginLoadOrder::POSTWORLD);
|
$this->enablePlugins(PluginLoadOrder::POSTWORLD);
|
||||||
|
|
||||||
|
$this->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user