GameMode is now an enum

This commit is contained in:
Dylan K. Taylor
2019-03-31 16:19:36 +01:00
parent 0017c0087a
commit 42a263a9df
9 changed files with 128 additions and 104 deletions

View File

@ -422,10 +422,10 @@ class Server{
}
/**
* @return int
* @return GameMode
*/
public function getGamemode() : int{
return $this->getConfigInt("gamemode", 0) & 0b11;
public function getGamemode() : GameMode{
return GameMode::fromMagicNumber($this->getConfigInt("gamemode", 0) & 0b11);
}
/**
@ -1322,7 +1322,7 @@ class Server{
$this->tickCounter = 0;
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.defaultGameMode", [GameMode::toTranslation($this->getGamemode())]));
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.defaultGameMode", [$this->getGamemode()->getTranslationKey()]));
$this->logger->info($this->getLanguage()->translateString("pocketmine.server.startFinished", [round(microtime(true) - \pocketmine\START_TIME, 3)]));