diff --git a/src/classes/Player.php b/src/classes/Player.php index 4551b82d4..ac8980046 100644 --- a/src/classes/Player.php +++ b/src/classes/Player.php @@ -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?