mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-19 15:35:52 +00:00
Improved player spawn item in hand sending
This commit is contained in:
parent
dd3207cbd8
commit
cd135b39ad
@ -169,8 +169,9 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
$pk->z = $this->z;
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->unknown1 = 0;
|
||||
$pk->unknown2 = 0;
|
||||
$item = $this->getInventory()->getItemInHand();
|
||||
$pk->item = $item->getID();
|
||||
$pk->meta = $item->getDamage();
|
||||
$pk->metadata = $this->getData();
|
||||
$player->dataPacket($pk);
|
||||
|
||||
@ -180,8 +181,6 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
|
||||
];
|
||||
$player->dataPacket($pk);
|
||||
|
||||
$this->inventory->sendHeldItem($player);
|
||||
|
||||
$this->inventory->sendArmorContents($player);
|
||||
}
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ class AddPlayerPacket extends DataPacket{
|
||||
public $z;
|
||||
public $pitch;
|
||||
public $yaw;
|
||||
public $unknown1;
|
||||
public $unknown2;
|
||||
public $item;
|
||||
public $meta;
|
||||
public $metadata;
|
||||
|
||||
public function pid(){
|
||||
@ -61,8 +61,8 @@ class AddPlayerPacket extends DataPacket{
|
||||
$this->putFloat($this->z);
|
||||
$this->putByte((int) ($this->yaw * (256 / 360)));
|
||||
$this->putByte((int) ($this->pitch * (256 / 360)));
|
||||
$this->putShort($this->unknown1);
|
||||
$this->putShort($this->unknown2);
|
||||
$this->putShort($this->item);
|
||||
$this->putShort($this->meta);
|
||||
$this->put(Binary::writeMetadata($this->metadata));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user