mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Added yaw/pitch on spawn
This commit is contained in:
parent
4b3addb8a0
commit
bcb401c0c3
@ -30,6 +30,8 @@ use pocketmine\nbt\tag\Compound;
|
||||
use pocketmine\nbt\tag\Enum;
|
||||
use pocketmine\nbt\tag\Short;
|
||||
use pocketmine\network\protocol\AddPlayerPacket;
|
||||
use pocketmine\network\protocol\MoveEntityPacket_PosRot;
|
||||
use pocketmine\network\protocol\MovePlayerPacket;
|
||||
use pocketmine\network\protocol\RemovePlayerPacket;
|
||||
use pocketmine\network\protocol\SetEntityMotionPacket;
|
||||
use pocketmine\Network;
|
||||
@ -145,8 +147,8 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$pk->x = $this->x;
|
||||
$pk->y = $this->y;
|
||||
$pk->z = $this->z;
|
||||
$pk->yaw = 0;
|
||||
$pk->pitch = 0;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->unknown1 = 0;
|
||||
$pk->unknown2 = 0;
|
||||
$pk->metadata = $this->getData();
|
||||
|
@ -48,8 +48,8 @@ class AddMobPacket extends DataPacket{
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte($this->yaw);
|
||||
$this->putByte($this->pitch);
|
||||
$this->putByte(floor($this->yaw * (256 / 360)));
|
||||
$this->putByte(floor($this->pitch * (256 / 360)));
|
||||
$this->put(Binary::writeMetadata($this->metadata));
|
||||
}
|
||||
|
||||
|
@ -52,8 +52,8 @@ class AddPlayerPacket extends DataPacket{
|
||||
$this->putFloat($this->x);
|
||||
$this->putFloat($this->y);
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte($this->yaw);
|
||||
$this->putByte($this->pitch);
|
||||
$this->putByte((int) ($this->yaw * (256 / 360)));
|
||||
$this->putByte((int) ($this->pitch * (256 / 360)));
|
||||
$this->putShort($this->unknown1);
|
||||
$this->putShort($this->unknown2);
|
||||
$this->put(Binary::writeMetadata($this->metadata));
|
||||
|
Loading…
x
Reference in New Issue
Block a user