Fixed respawning

This commit is contained in:
Stephen
2019-11-05 22:33:12 -05:00
parent 17a17c31f3
commit 07f19dd4a1
3 changed files with 21 additions and 4 deletions

View File

@ -32,22 +32,26 @@ use pocketmine\network\mcpe\NetworkSession;
class RespawnPacket extends DataPacket{
public const NETWORK_ID = ProtocolInfo::RESPAWN_PACKET;
public const SEARCHING_FOR_SPAWN = 0;
public const READY_TO_SPAWN = 1;
public const CLIENT_READY_TO_SPAWN = 2;
/** @var Vector3 */
public $position;
/** @var int */
public $respawnState = 1; //TODO: Add
public $respawnState = self::SEARCHING_FOR_SPAWN;
/** @var int */
public $entityRuntimeId;
protected function decodePayload(){
$this->position = $this->getVector3();
$this->respawnState = $this->getInt();
$this->respawnState = $this->getByte();
$this->entityRuntimeId = $this->getEntityRuntimeId();
}
protected function encodePayload(){
$this->putVector3($this->position);
$this->putInt($this->respawnState);
$this->putByte($this->respawnState);
$this->putEntityRuntimeId($this->entityRuntimeId);
}