diff --git a/src/pocketmine/entity/Item.php b/src/pocketmine/entity/Item.php index d20cebf29..2fd58b23c 100644 --- a/src/pocketmine/entity/Item.php +++ b/src/pocketmine/entity/Item.php @@ -230,14 +230,12 @@ class Item extends Entity{ $pk->x = $this->x; $pk->y = $this->y; $pk->z = $this->z; - $pk->yaw = $this->yaw; - $pk->pitch = $this->pitch; - $pk->roll = 0; + $pk->speedX = $this->motionX; + $pk->speedY = $this->motionY; + $pk->speedZ = $this->motionZ; $pk->item = $this->getItem(); $player->dataPacket($pk); - $player->addEntityMotion($this->getId(), $this->motionX, $this->motionY, $this->motionZ); - parent::spawnTo($player); } -} \ No newline at end of file +} diff --git a/src/pocketmine/network/protocol/AddEntityPacket.php b/src/pocketmine/network/protocol/AddEntityPacket.php index aac99adc5..a4694eb2c 100644 --- a/src/pocketmine/network/protocol/AddEntityPacket.php +++ b/src/pocketmine/network/protocol/AddEntityPacket.php @@ -55,9 +55,9 @@ class AddEntityPacket extends DataPacket{ $this->putFloat($this->z); $this->putLong($this->did); if($this->did > 0){ - $this->putShort($this->speedX * 8000); - $this->putShort($this->speedY * 8000); - $this->putShort($this->speedZ * 8000); + $this->putFloat($this->speedX); + $this->putFloat($this->speedY); + $this->putFloat($this->speedZ); } } diff --git a/src/pocketmine/network/protocol/AddItemEntityPacket.php b/src/pocketmine/network/protocol/AddItemEntityPacket.php index c8fe7a1aa..dca5ca13a 100644 --- a/src/pocketmine/network/protocol/AddItemEntityPacket.php +++ b/src/pocketmine/network/protocol/AddItemEntityPacket.php @@ -33,9 +33,9 @@ class AddItemEntityPacket extends DataPacket{ public $x; public $y; public $z; - public $yaw; - public $pitch; - public $roll; + public $speedX; + public $speedY; + public $speedZ; public function pid(){ return Info::ADD_ITEM_ENTITY_PACKET; @@ -52,9 +52,9 @@ class AddItemEntityPacket extends DataPacket{ $this->putFloat($this->x); $this->putFloat($this->y); $this->putFloat($this->z); - $this->putByte($this->yaw); - $this->putByte($this->pitch); - $this->putByte($this->roll); + $this->putFloat($this->speedX); + $this->putFloat($this->speedY); + $this->putFloat($this->speedZ); } } diff --git a/src/pocketmine/network/protocol/AddMobPacket.php b/src/pocketmine/network/protocol/AddMobPacket.php index 5a2123e4a..f8d18a759 100644 --- a/src/pocketmine/network/protocol/AddMobPacket.php +++ b/src/pocketmine/network/protocol/AddMobPacket.php @@ -53,11 +53,11 @@ class AddMobPacket extends DataPacket{ $this->reset(); $this->putLong($this->eid); $this->putInt($this->type); - $this->putInt($this->x); - $this->putInt($this->y); - $this->putInt($this->z); - $this->putByte(floor($this->yaw * (256 / 360))); - $this->putByte(floor($this->pitch * (256 / 360))); + $this->putFloat($this->x); + $this->putFloat($this->y); + $this->putFloat($this->z); + $this->putFloat($this->yaw); + $this->putFloat($this->pitch); $this->put(Binary::writeMetadata($this->metadata)); } diff --git a/src/pocketmine/network/protocol/AddPlayerPacket.php b/src/pocketmine/network/protocol/AddPlayerPacket.php index b54dd6b0f..49dc53eb3 100644 --- a/src/pocketmine/network/protocol/AddPlayerPacket.php +++ b/src/pocketmine/network/protocol/AddPlayerPacket.php @@ -60,8 +60,8 @@ class AddPlayerPacket extends DataPacket{ $this->putFloat($this->x); $this->putFloat($this->y); $this->putFloat($this->z); - $this->putByte((int) ($this->yaw * (256 / 360))); - $this->putByte((int) ($this->pitch * (256 / 360))); + $this->putFloat($this->yaw); + $this->putFloat($this->pitch); $this->putShort($this->item); $this->putShort($this->meta); $this->put(Binary::writeMetadata($this->metadata));