Don't write server.properties to disk unless it's been modified at runtime

This commit is contained in:
Dylan K. Taylor
2017-11-20 10:04:39 +00:00
parent feade9d982
commit 32714d4564

View File

@ -1714,8 +1714,9 @@ class Server{
$this->setDefaultLevel($this->getLevelByName($default)); $this->setDefaultLevel($this->getLevelByName($default));
} }
if($this->properties->hasChanged()){
$this->properties->save(true); $this->properties->save(true);
}
if(!($this->getDefaultLevel() instanceof Level)){ if(!($this->getDefaultLevel() instanceof Level)){
$this->getLogger()->emergency($this->getLanguage()->translateString("pocketmine.level.defaultError")); $this->getLogger()->emergency($this->getLanguage()->translateString("pocketmine.level.defaultError"));
@ -2073,8 +2074,10 @@ class Server{
$this->scheduler->mainThreadHeartbeat(PHP_INT_MAX); $this->scheduler->mainThreadHeartbeat(PHP_INT_MAX);
} }
$this->getLogger()->debug("Saving properties"); if($this->properties->hasChanged()){
$this->properties->save(); $this->getLogger()->debug("Saving properties");
$this->properties->save();
}
$this->getLogger()->debug("Closing console"); $this->getLogger()->debug("Closing console");
$this->console->shutdown(); $this->console->shutdown();