mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Fixed item restoration duplication
This commit is contained in:
parent
5101391c29
commit
a0cb4d2698
@ -429,18 +429,17 @@ class Player{
|
||||
$this->eventHandler("Your connection is bad, you may experience lag and slow map loading.", "server.chat");
|
||||
}
|
||||
foreach($this->inventory as $s => $data){
|
||||
if($data[0] <= 0 or $data[2] <= 0){
|
||||
$this->inventory[$s] = array(0, 0, 0);
|
||||
continue;
|
||||
if($data[0] >= 0 or $data[2] >= 0){
|
||||
$e = $this->server->api->entity->add(ENTITY_ITEM, $data[0], array(
|
||||
"x" => $this->entity->x + 0.5,
|
||||
"y" => $this->entity->y + 0.19,
|
||||
"z" => $this->entity->z + 0.5,
|
||||
"meta" => $data[1],
|
||||
"stack" => $data[2],
|
||||
));
|
||||
$this->server->api->entity->spawnTo($e->eid, $this);
|
||||
}
|
||||
$e = $this->server->api->entity->add(ENTITY_ITEM, $data[0], array(
|
||||
"x" => $this->entity->x + 0.5,
|
||||
"y" => $this->entity->y + 0.19,
|
||||
"z" => $this->entity->z + 0.5,
|
||||
"meta" => $data[1],
|
||||
"stack" => $data[2],
|
||||
));
|
||||
$this->server->api->entity->spawnTo($e->eid, $this);
|
||||
$this->inventory[$s] = array(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
case 2://Chunk loaded?
|
||||
|
Loading…
x
Reference in New Issue
Block a user