mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Protocol updates for 1.1.0.9
This commit is contained in:
@ -31,7 +31,8 @@ class MovePlayerPacket extends DataPacket{
|
||||
|
||||
const MODE_NORMAL = 0;
|
||||
const MODE_RESET = 1;
|
||||
const MODE_ROTATION = 2;
|
||||
const MODE_TELEPORT = 2;
|
||||
const MODE_PITCH = 3; //facepalm Mojang
|
||||
|
||||
public $eid;
|
||||
public $x;
|
||||
@ -43,6 +44,8 @@ class MovePlayerPacket extends DataPacket{
|
||||
public $mode = self::MODE_NORMAL;
|
||||
public $onGround;
|
||||
public $ridingEid;
|
||||
public $int1 = 0;
|
||||
public $int2 = 0;
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getEntityRuntimeId();
|
||||
@ -53,6 +56,10 @@ class MovePlayerPacket extends DataPacket{
|
||||
$this->mode = $this->getByte();
|
||||
$this->onGround = $this->getBool();
|
||||
$this->ridingEid = $this->getEntityRuntimeId();
|
||||
if($this->mode === MovePlayerPacket::MODE_TELEPORT){
|
||||
$this->int1 = $this->getLInt();
|
||||
$this->int2 = $this->getLInt();
|
||||
}
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -65,6 +72,10 @@ class MovePlayerPacket extends DataPacket{
|
||||
$this->putByte($this->mode);
|
||||
$this->putBool($this->onGround);
|
||||
$this->putEntityRuntimeId($this->ridingEid);
|
||||
if($this->mode === MovePlayerPacket::MODE_TELEPORT){
|
||||
$this->putLInt($this->int1);
|
||||
$this->putLInt($this->int2);
|
||||
}
|
||||
}
|
||||
|
||||
public function handle(NetworkSession $session) : bool{
|
||||
|
Reference in New Issue
Block a user