mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
Fixed chunk loading and movement
This commit is contained in:
parent
dd0c5efb56
commit
401de97719
@ -32,14 +32,15 @@ class AdventureSettingsPacket extends DataPacket{
|
||||
public $globalPermission;
|
||||
|
||||
public function decode(){
|
||||
|
||||
$this->flags = $this->getUnsignedVarInt();
|
||||
$this->userPermission = $this->getUnsignedVarInt();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->flags);
|
||||
$this->putInt($this->userPermission);
|
||||
$this->putInt($this->globalPermission);
|
||||
$this->putUnsignedVarInt($this->flags);
|
||||
$this->putUnsignedVarInt($this->userPermission); //TODO: verify this
|
||||
//$this->putInt($this->globalPermission);
|
||||
}
|
||||
|
||||
}
|
@ -34,7 +34,7 @@ class ChunkRadiusUpdatedPacket extends DataPacket{
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->radius);
|
||||
$this->putVarInt($this->radius);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -41,11 +41,10 @@ class FullChunkDataPacket extends DataPacket{
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->chunkX);
|
||||
$this->putInt($this->chunkZ);
|
||||
$this->putVarInt($this->chunkX);
|
||||
$this->putVarInt($this->chunkZ);
|
||||
$this->putByte($this->order);
|
||||
$this->putInt(strlen($this->data));
|
||||
$this->put($this->data);
|
||||
$this->putString($this->data);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -47,26 +47,22 @@ class MovePlayerPacket extends DataPacket{
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getLong();
|
||||
$this->x = $this->getFloat();
|
||||
$this->y = $this->getFloat();
|
||||
$this->z = $this->getFloat();
|
||||
$this->yaw = $this->getFloat();
|
||||
$this->bodyYaw = $this->getFloat();
|
||||
$this->pitch = $this->getFloat();
|
||||
$this->eid = $this->getEntityId(); //EntityRuntimeID
|
||||
$this->getVector3f($this->x, $this->y, $this->z);
|
||||
$this->pitch = $this->getLFloat();
|
||||
$this->yaw = $this->getLFloat();
|
||||
$this->bodyYaw = $this->getLFloat();
|
||||
$this->mode = $this->getByte();
|
||||
$this->onGround = $this->getByte() > 0;
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putLong($this->eid);
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putFloat($this->yaw);
|
||||
$this->putFloat($this->bodyYaw); //TODO
|
||||
$this->putFloat($this->pitch);
|
||||
$this->putEntityId($this->eid); //EntityRuntimeID
|
||||
$this->putVector3f($this->x, $this->y, $this->z);
|
||||
$this->putLFloat($this->pitch);
|
||||
$this->putLFloat($this->yaw);
|
||||
$this->putLFloat($this->bodyYaw); //TODO
|
||||
$this->putByte($this->mode);
|
||||
$this->putByte($this->onGround > 0);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class RequestChunkRadiusPacket extends DataPacket{
|
||||
public $radius;
|
||||
|
||||
public function decode(){
|
||||
$this->radius = $this->getInt();
|
||||
$this->radius = $this->getVarInt();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user