mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Added item save check
This commit is contained in:
parent
1d2de1f038
commit
3fb99e118c
@ -232,16 +232,20 @@ class Player{
|
|||||||
));
|
));
|
||||||
$inv = array();
|
$inv = array();
|
||||||
foreach($this->inventory as $slot => $item){
|
foreach($this->inventory as $slot => $item){
|
||||||
|
if($item instanceof Item){
|
||||||
if($slot < (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS)){
|
if($slot < (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS)){
|
||||||
$inv[$slot] = array($item->getID(), $item->getMetadata(), $item->count);
|
$inv[$slot] = array($item->getID(), $item->getMetadata(), $item->count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$this->data->set("inventory", $inv);
|
$this->data->set("inventory", $inv);
|
||||||
|
|
||||||
$armor = array();
|
$armor = array();
|
||||||
foreach($this->armor as $slot => $item){
|
foreach($this->armor as $slot => $item){
|
||||||
|
if($item instanceof Item){
|
||||||
$armor[$slot] = array($item->getID(), $item->getMetadata());
|
$armor[$slot] = array($item->getID(), $item->getMetadata());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$this->data->set("armor", $armor);
|
$this->data->set("armor", $armor);
|
||||||
$this->data->set("gamemode", $this->gamemode);
|
$this->data->set("gamemode", $this->gamemode);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user