Fixed picking up items, entity IDs on packets

This commit is contained in:
Shoghi Cervantes 2015-03-12 11:43:24 +01:00
parent 4b442a9d7c
commit 00942d3a2b
6 changed files with 11 additions and 16 deletions

View File

@ -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();

View File

@ -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();
}
@ -46,4 +46,4 @@ class DropItemPacket extends DataPacket{
}
}
}

View File

@ -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(){

View File

@ -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);
}
}

View File

@ -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();
@ -48,4 +48,4 @@ class RemoveBlockPacket extends DataPacket{
}
}
}

View File

@ -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);
}