mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added item save check
This commit is contained in:
parent
1d2de1f038
commit
3fb99e118c
1 changed files with 7 additions and 3 deletions
|
|
@ -232,15 +232,19 @@ class Player{
|
|||
));
|
||||
$inv = array();
|
||||
foreach($this->inventory as $slot => $item){
|
||||
if($slot < (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS)){
|
||||
$inv[$slot] = array($item->getID(), $item->getMetadata(), $item->count);
|
||||
if($item instanceof Item){
|
||||
if($slot < (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS)){
|
||||
$inv[$slot] = array($item->getID(), $item->getMetadata(), $item->count);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->data->set("inventory", $inv);
|
||||
|
||||
$armor = array();
|
||||
foreach($this->armor as $slot => $item){
|
||||
$armor[$slot] = array($item->getID(), $item->getMetadata());
|
||||
if($item instanceof Item){
|
||||
$armor[$slot] = array($item->getID(), $item->getMetadata());
|
||||
}
|
||||
}
|
||||
$this->data->set("armor", $armor);
|
||||
$this->data->set("gamemode", $this->gamemode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue