skins fixed and added SetPlayerGameTypePacket

This commit is contained in:
Intyre
2015-11-26 00:47:58 +01:00
parent 2e5490fb5b
commit c803dd8e69
6 changed files with 48 additions and 16 deletions

View File

@ -113,6 +113,7 @@ use pocketmine\network\protocol\Info as ProtocolInfo;
use pocketmine\network\protocol\PlayerActionPacket;
use pocketmine\network\protocol\PlayStatusPacket;
use pocketmine\network\protocol\RespawnPacket;
use pocketmine\network\protocol\SetPlayerGameTypePacket;
use pocketmine\network\protocol\TextPacket;
use pocketmine\network\protocol\MovePlayerPacket;
@ -1085,7 +1086,6 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
return false;
}
$this->gamemode = $gm;
$this->allowFlight = $this->isCreative();
@ -1098,19 +1098,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->namedtag->playerGameType = new Int("playerGameType", $this->gamemode);
$spawnPosition = $this->getSpawn();
$pk = new StartGamePacket();
$pk->seed = -1;
$pk->x = $this->x;
$pk->y = $this->y;
$pk->z = $this->z;
$pk->spawnX = (int) $spawnPosition->x;
$pk->spawnY = (int) $spawnPosition->y;
$pk->spawnZ = (int) $spawnPosition->z;
$pk->generator = 1; //0 old, 1 infinite, 2 flat
$pk = new SetPlayerGameTypePacket();
$pk->gamemode = $this->gamemode & 0x01;
$pk->eid = 0;
$this->dataPacket($pk);
$this->sendSettings();