Skip to content

Commit

Permalink
changed type of EntityLink unknown field and added a constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
dktapps committed Oct 25, 2017
1 parent 1d65104 commit bd2cb85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/pocketmine/network/mcpe/protocol/DataPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,11 @@ public function putGameRules(array $rules){
*/
protected function getEntityLink() : EntityLink{
$link = new EntityLink();

$link->fromEntityUniqueId = $this->getEntityUniqueId();
$link->toEntityUniqueId = $this->getEntityUniqueId();
$link->type = $this->getByte();
$link->byte2 = $this->getByte();
$link->bool1 = $this->getBool();

return $link;
}
Expand All @@ -534,7 +535,6 @@ protected function putEntityLink(EntityLink $link){
$this->putEntityUniqueId($link->fromEntityUniqueId);
$this->putEntityUniqueId($link->toEntityUniqueId);
$this->putByte($link->type);
$this->putByte($link->byte2);

$this->putBool($link->bool1);
}
}
10 changes: 8 additions & 2 deletions src/pocketmine/network/mcpe/protocol/types/EntityLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ class EntityLink{
public $toEntityUniqueId;
/** @var int */
public $type;
/** @var int */
public $byte2;
/** @var bool */
public $bool1;

public function __construct(int $fromEntityUniqueId = null, int $toEntityUniqueId = null, int $type = null, bool $bool1 = null){
$this->fromEntityUniqueId = $fromEntityUniqueId;
$this->toEntityUniqueId = $toEntityUniqueId;
$this->type = $type;
$this->bool1 = $bool1;
}
}

0 comments on commit bd2cb85

Please sign in to comment.