mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Found unknown fields for SetSpawnPositionPacket
This commit is contained in:
parent
af06d78725
commit
954271b90f
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user