mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 04:59:46 +00:00
Fixed item restoration duplication
This commit is contained in:
parent
5101391c29
commit
a0cb4d2698
1 changed files with 10 additions and 11 deletions
|
|
@ -429,10 +429,7 @@ 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);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$e = $this->server->api->entity->add(ENTITY_ITEM, $data[0], array(
|
$e = $this->server->api->entity->add(ENTITY_ITEM, $data[0], array(
|
||||||
"x" => $this->entity->x + 0.5,
|
"x" => $this->entity->x + 0.5,
|
||||||
"y" => $this->entity->y + 0.19,
|
"y" => $this->entity->y + 0.19,
|
||||||
|
|
@ -442,6 +439,8 @@ class Player{
|
||||||
));
|
));
|
||||||
$this->server->api->entity->spawnTo($e->eid, $this);
|
$this->server->api->entity->spawnTo($e->eid, $this);
|
||||||
}
|
}
|
||||||
|
$this->inventory[$s] = array(0, 0, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2://Chunk loaded?
|
case 2://Chunk loaded?
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue