Cleaned up ping response and added missing fields (#1114)

This commit is contained in:
Dylan K. Taylor
2017-07-04 11:17:47 +01:00
committed by GitHub
parent d474f73665
commit 409fc282d2
3 changed files with 29 additions and 8 deletions

View File

@ -441,6 +441,21 @@ class Server{
return "UNKNOWN";
}
public static function getGamemodeName(int $mode) : string{
switch($mode){
case Player::SURVIVAL:
return "Survival";
case Player::CREATIVE:
return "Creative";
case Player::ADVENTURE:
return "Adventure";
case Player::SPECTATOR:
return "Spectator";
default:
throw new \InvalidArgumentException("Invalid gamemode $mode");
}
}
/**
* Parses a string and returns a gamemode integer, -1 if not found
*