New VIEW gamemode

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-18 16:40:30 +02:00
parent 5848d283da
commit 3577667039
10 changed files with 58 additions and 32 deletions

View file

@ -132,7 +132,12 @@ class PlayerAPI{
"c" => CREATIVE,
"2" => ADVENTURE,
"adventure" => ADVENTURE,
"a" => ADVENTURE,
"a" => ADVENTURE,
"3" => VIEW,
"view" => VIEW,
"viewer" => VIEW,
"spectator" => VIEW,
"v" => VIEW,
);
if($issuer instanceof Player){
$player = $issuer;
@ -328,7 +333,7 @@ class PlayerAPI{
console("[NOTICE] Player data not found for \"".$iname."\", creating new profile");
$data->save();
}
if($this->server->gamemode === CREATIVE){
if(($this->server->gamemode & 0x01) === 0x01){
$data->set("health", 20);
}
$this->server->handle("player.offline.get", $data);