mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Cleaned up muddled varint/varlong mess, added separate methods for entity unique and runtime ids, moved some MCPE-protocol-specific methods out of BinaryStream
This commit is contained in:
@ -55,17 +55,17 @@ class PlayerActionPacket extends DataPacket{
|
||||
public $face;
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getEntityId();
|
||||
$this->eid = $this->getEntityRuntimeId();
|
||||
$this->action = $this->getVarInt();
|
||||
$this->getBlockCoords($this->x, $this->y, $this->z);
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->face = $this->getVarInt();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putEntityId($this->eid);
|
||||
$this->putEntityRuntimeId($this->eid);
|
||||
$this->putVarInt($this->action);
|
||||
$this->putBlockCoords($this->x, $this->y, $this->z);
|
||||
$this->putBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->putVarInt($this->face);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user