diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index c68676893..8ac13817b 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -126,7 +126,7 @@ class PlayerAPI{ if(!($player instanceof Player) or $gm < 0 or $gm > 2){ $output .= "Usage: /gamemode [player] <0 | 1 | 2>\n"; break; - } + } if($player->setGamemode($gm)){ diff --git a/src/Player.php b/src/Player.php index 2fc32c56c..7caa7b0d6 100644 --- a/src/Player.php +++ b/src/Player.php @@ -434,13 +434,14 @@ class Player{ } } - public function sendSettings(){ + public function sendSettings($nametags = true){ /* + bit mask | flag name 0x00000001 world_inmutable - 0x00000002 ? - 0x00000004 ? - 0x00000008 ? - 0x00000010 ? + 0x00000002 - + 0x00000004 - + 0x00000008 - (autojump) + 0x00000010 - 0x00000020 nametags_visible 0x00000040 ? 0x00000080 ? @@ -473,7 +474,11 @@ class Player{ if($this->gamemode === ADVENTURE){ $flags |= 0x01; //Not allow placing/breaking blocks } - $flags |= 0x20; //Show Nametags + + if($nametags !== false){ + $flags |= 0x20; //Show Nametags + } + $this->dataPacket(MC_ADVENTURE_SETTINGS, array( "flags" => $flags, )); @@ -484,8 +489,8 @@ class Player{ $this->entity->fallY = false; $this->entity->fallStart = false; $this->entity->setPosition($pos->x, $pos->y, $pos->z, $yaw, $pitch); - $this->entity->calculateVelocity(); $this->entity->updateLast(); + $this->entity->calculateVelocity(); } $this->dataPacket(MC_MOVE_PLAYER, array( "eid" => 0,