mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Typehinted things in BinaryStream, sorted some methods and related bugfixes
This commit is contained in:
@ -46,7 +46,7 @@ class BatchPacket extends DataPacket{
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->payload = $this->get(true);
|
||||
$this->payload = $this->get(0);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
@ -38,7 +38,7 @@ class BlockEntityDataPacket extends DataPacket{
|
||||
|
||||
public function decode(){
|
||||
$this->getBlockPosition($this->x, $this->y, $this->z);
|
||||
$this->namedtag = $this->get(true);
|
||||
$this->namedtag = $this->get(0);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
@ -49,7 +49,7 @@ class CommandStepPacket extends DataPacket{
|
||||
$this->inputJson = json_decode($this->getString());
|
||||
$this->outputJson = json_decode($this->getString());
|
||||
|
||||
$this->get(true); //TODO: read command origin data
|
||||
$this->get(0); //TODO: read command origin data
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
@ -117,7 +117,7 @@ abstract class DataPacket extends BinaryStream{
|
||||
$value = $this->getByte();
|
||||
break;
|
||||
case Entity::DATA_TYPE_SHORT:
|
||||
$value = $this->getLShort(true); //signed
|
||||
$value = $this->getSignedLShort();
|
||||
break;
|
||||
case Entity::DATA_TYPE_INT:
|
||||
$value = $this->getVarInt();
|
||||
|
@ -38,8 +38,8 @@ class MoveEntityPacket extends DataPacket{
|
||||
public $yaw;
|
||||
public $headYaw;
|
||||
public $pitch;
|
||||
public $onGround;
|
||||
public $teleported;
|
||||
public $onGround = false;
|
||||
public $teleported = false;
|
||||
|
||||
public function decode(){
|
||||
$this->entityRuntimeId = $this->getEntityRuntimeId();
|
||||
|
@ -47,13 +47,13 @@ class StartGamePacket extends DataPacket{
|
||||
public $spawnX;
|
||||
public $spawnY;
|
||||
public $spawnZ;
|
||||
public $hasAchievementsDisabled = 1;
|
||||
public $hasAchievementsDisabled = true;
|
||||
public $dayCycleStopTime = -1; //-1 = not stopped, any positive value = stopped at that time
|
||||
public $eduMode = 0;
|
||||
public $eduMode = false;
|
||||
public $rainLevel;
|
||||
public $lightningLevel;
|
||||
public $commandsEnabled;
|
||||
public $isTexturePacksRequired = 0;
|
||||
public $isTexturePacksRequired = true;
|
||||
public $levelId = ""; //base64 string, usually the same as world folder name in vanilla
|
||||
public $worldName;
|
||||
public $premiumWorldTemplateId = "";
|
||||
|
@ -45,7 +45,7 @@ class UnknownPacket extends DataPacket{
|
||||
|
||||
public function decode(){
|
||||
$this->offset -= 1; //Rewind one byte so we can read the PID
|
||||
$this->payload = $this->get(true);
|
||||
$this->payload = $this->get(0);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
@ -53,7 +53,7 @@ class UpdateTradePacket extends DataPacket{
|
||||
$this->traderEid = $this->getEntityUniqueId();
|
||||
$this->playerEid = $this->getEntityUniqueId();
|
||||
$this->displayName = $this->getString();
|
||||
$this->offers = $this->get(true);
|
||||
$this->offers = $this->get(0);
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
Reference in New Issue
Block a user