Added encode and decode methods for more packets

This commit is contained in:
Dylan K. Taylor
2017-05-15 15:56:59 +01:00
parent 162a08b8cb
commit 0a4d62b405
57 changed files with 244 additions and 78 deletions

View File

@ -34,10 +34,13 @@ class ContainerOpenPacket extends DataPacket{
public $x;
public $y;
public $z;
public $entityId = -1;
public $entityUniqueId = -1;
public function decode(){
$this->windowid = $this->getByte();
$this->type = $this->getByte();
$this->getBlockPosition($this->x, $this->y, $this->z);
$this->entityUniqueId = $this->getEntityUniqueId();
}
public function encode(){
@ -45,7 +48,7 @@ class ContainerOpenPacket extends DataPacket{
$this->putByte($this->windowid);
$this->putByte($this->type);
$this->putBlockPosition($this->x, $this->y, $this->z);
$this->putEntityUniqueId($this->entityId);
$this->putEntityUniqueId($this->entityUniqueId);
}
public function handle(NetworkSession $session) : bool{