diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index aa3f5f48d..4a59a6dee 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -1180,6 +1180,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade $pk->x = (int) $this->spawnPosition->x; $pk->y = (int) $this->spawnPosition->y; $pk->z = (int) $this->spawnPosition->z; + $pk->spawnType = SetSpawnPositionPacket::TYPE_PLAYER_SPAWN; $this->dataPacket($pk); } diff --git a/src/pocketmine/network/mcpe/protocol/SetSpawnPositionPacket.php b/src/pocketmine/network/mcpe/protocol/SetSpawnPositionPacket.php index 98ca3d027..e4c079a53 100644 --- a/src/pocketmine/network/mcpe/protocol/SetSpawnPositionPacket.php +++ b/src/pocketmine/network/mcpe/protocol/SetSpawnPositionPacket.php @@ -29,23 +29,26 @@ use pocketmine\network\mcpe\NetworkSession; class SetSpawnPositionPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::SET_SPAWN_POSITION_PACKET; - public $unknown; + const TYPE_PLAYER_SPAWN = 0; + const TYPE_WORLD_SPAWN = 1; + + public $spawnType; public $x; public $y; public $z; - public $unknownBool; + public $spawnForced; public function decode(){ - $this->unknown = $this->getVarInt(); + $this->spawnType = $this->getVarInt(); $this->getBlockPosition($this->x, $this->y, $this->z); - $this->unknownBool = $this->getBool(); + $this->spawnForced = $this->getBool(); } public function encode(){ $this->reset(); - $this->putVarInt($this->unknown); + $this->putVarInt($this->spawnType); $this->putBlockPosition($this->x, $this->y, $this->z); - $this->putBool($this->unknownBool); + $this->putBool($this->spawnForced); } public function handle(NetworkSession $session) : bool{