diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 94b4305f1..e1fc23261 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1300,7 +1300,7 @@ class Server{ if(($player = $this->getPlayerExact($name)) !== null){ $player->recalculatePermissions(); } - $this->operators->save(true); + $this->operators->save(); } /** @@ -1320,7 +1320,7 @@ class Server{ */ public function addWhitelist(string $name){ $this->whitelist->set(strtolower($name), true); - $this->whitelist->save(true); + $this->whitelist->save(); } /** @@ -1691,7 +1691,7 @@ class Server{ } if($this->properties->hasChanged()){ - $this->properties->save(true); + $this->properties->save(); } if(!($this->getDefaultLevel() instanceof Level)){ diff --git a/src/pocketmine/utils/Config.php b/src/pocketmine/utils/Config.php index c8609afdc..30ab3dadd 100644 --- a/src/pocketmine/utils/Config.php +++ b/src/pocketmine/utils/Config.php @@ -23,7 +23,6 @@ declare(strict_types=1); namespace pocketmine\utils; -use pocketmine\scheduler\FileWriteTask; use pocketmine\Server; @@ -187,11 +186,9 @@ class Config{ } /** - * @param bool $async - * * @return bool */ - public function save(bool $async = false) : bool{ + public function save() : bool{ if($this->correct){ try{ $content = null; @@ -216,11 +213,7 @@ class Config{ throw new \InvalidStateException("Config type is unknown, has not been set or not detected"); } - if($async){ - Server::getInstance()->getAsyncPool()->submitTask(new FileWriteTask($this->file, $content)); - }else{ - file_put_contents($this->file, $content); - } + file_put_contents($this->file, $content); }catch(\Throwable $e){ $logger = Server::getInstance()->getLogger(); $logger->critical("Could not save Config " . $this->file . ": " . $e->getMessage());