Move gamemode constants & functions to their own class

future enhancements:
- make gamemode an object containing information about abilities that players have in this gamemode (gamemodes are just predefined ability sets)
- get the magic numbers out of the API
This commit is contained in:
Dylan K. Taylor
2019-01-12 16:10:14 +00:00
parent 49bdd92faa
commit a756519e6b
6 changed files with 128 additions and 94 deletions

View File

@ -23,6 +23,7 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe;
use pocketmine\Gamemode;
use pocketmine\network\AdvancedNetworkInterface;
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\network\Network;
@ -196,7 +197,7 @@ class RakLibInterface implements ServerInstance, AdvancedNetworkInterface{
$info->getMaxPlayerCount(),
$this->rakLib->getServerId(),
$this->server->getName(),
Server::getGamemodeName($this->server->getGamemode())
Gamemode::toString($this->server->getGamemode())
]) . ";"
);
}