mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Fixed picking up items, entity IDs on packets
This commit is contained in:
parent
4b442a9d7c
commit
00942d3a2b
@ -645,7 +645,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
}
|
||||
}
|
||||
|
||||
if($spawned < 16){
|
||||
if($spawned < 8){
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1308,10 +1308,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
continue;
|
||||
}
|
||||
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->target = $entity->getId();
|
||||
$this->dataPacket($pk);
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->target = $entity->getId();
|
||||
@ -1342,10 +1338,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
break;
|
||||
}
|
||||
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->target = $entity->getId();
|
||||
$this->dataPacket($pk);
|
||||
$pk = new TakeItemEntityPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->target = $entity->getId();
|
||||
|
@ -37,7 +37,7 @@ class DropItemPacket extends DataPacket{
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getInt();
|
||||
$this->eid = $this->getLong();
|
||||
$this->unknown = $this->getByte();
|
||||
$this->item = $this->getSlot();
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ class InteractPacket extends DataPacket{
|
||||
|
||||
public function decode(){
|
||||
$this->action = $this->getByte();
|
||||
$this->eid = $this->getInt();
|
||||
$this->target = $this->getInt();
|
||||
$this->eid = $this->getLong();
|
||||
$this->target = $this->getLong();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
|
@ -32,6 +32,7 @@ class PlayerEquipmentPacket extends DataPacket{
|
||||
public $item;
|
||||
public $meta;
|
||||
public $slot;
|
||||
public $selectedSlot;
|
||||
|
||||
public function pid(){
|
||||
return Info::PLAYER_EQUIPMENT_PACKET;
|
||||
@ -42,6 +43,7 @@ class PlayerEquipmentPacket extends DataPacket{
|
||||
$this->item = $this->getShort();
|
||||
$this->meta = $this->getShort();
|
||||
$this->slot = $this->getByte();
|
||||
$this->selectedSlot = $this->getByte();
|
||||
}
|
||||
|
||||
public function encode(){
|
||||
@ -50,6 +52,7 @@ class PlayerEquipmentPacket extends DataPacket{
|
||||
$this->putShort($this->item);
|
||||
$this->putShort($this->meta);
|
||||
$this->putByte($this->slot);
|
||||
$this->putByte($this->selectedSlot);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class RemoveBlockPacket extends DataPacket{
|
||||
}
|
||||
|
||||
public function decode(){
|
||||
$this->eid = $this->getInt();
|
||||
$this->eid = $this->getLong();
|
||||
$this->x = $this->getInt();
|
||||
$this->z = $this->getInt();
|
||||
$this->y = $this->getByte();
|
||||
|
@ -41,7 +41,7 @@ class TakeItemEntityPacket extends DataPacket{
|
||||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->target);
|
||||
$this->putLong($this->target);
|
||||
$this->putLong($this->eid);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user