mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 17:29:44 +00:00
Less protocol madness
This commit is contained in:
parent
4ec584d800
commit
29ca349b3d
@ -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);
|
||||
}
|
||||
}
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user