mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +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");
|
$this->eventHandler("Your connection is bad, you may experience lag and slow map loading.", "server.chat");
|
||||||
}
|
}
|
||||||
foreach($this->inventory as $s => $data){
|
foreach($this->inventory as $s => $data){
|
||||||
if($data[0] <= 0 or $data[2] <= 0){
|
if($data[0] >= 0 or $data[2] >= 0){
|
||||||
$this->inventory[$s] = array(0, 0, 0);
|
$e = $this->server->api->entity->add(ENTITY_ITEM, $data[0], array(
|
||||||
continue;
|
"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(
|
$this->inventory[$s] = array(0, 0, 0);
|
||||||
"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);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2://Chunk loaded?
|
case 2://Chunk loaded?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user