mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-09 21:24:53 +00:00
Possible fix for armor crash
This commit is contained in:
parent
b776d9d5fc
commit
7efed17b74
@ -413,7 +413,7 @@ class PlayerAPI{
|
||||
"z" => $this->server->spawn->z,
|
||||
),
|
||||
"inventory" => array_fill(0, PLAYER_SURVIVAL_SLOTS, array(AIR, 0, 0)),
|
||||
"armor" => array_fill(0, 4, array(AIR, 0, 0)),
|
||||
"armor" => array_fill(0, 4, array(AIR, 0)),
|
||||
"gamemode" => $this->server->gamemode,
|
||||
"health" => 20,
|
||||
"lastIP" => "",
|
||||
|
@ -1097,7 +1097,7 @@ class Player{
|
||||
|
||||
$this->armor = array();
|
||||
foreach($this->data->get("armor") as $slot => $item){
|
||||
$this->armor[$slot] = BlockAPI::getItem($item[0], $item[1], 1);
|
||||
$this->armor[$slot] = BlockAPI::getItem($item[0], $item[1], $item[0] === 0 ? 0:1);
|
||||
}
|
||||
|
||||
$this->data->set("lastIP", $this->ip);
|
||||
@ -1365,7 +1365,7 @@ class Player{
|
||||
$this->armor[$i] = $this->getSlot($sl);
|
||||
$this->setSlot($sl, BlockAPI::getItem(AIR, 0, 0), false);
|
||||
}else{
|
||||
$data["slot$i"] = 0;
|
||||
$data["slot$i"] = 255;
|
||||
}
|
||||
|
||||
}
|
||||
@ -1708,7 +1708,7 @@ class Player{
|
||||
$data["slot$i"] = $this->armor[$i]->getID() !== AIR ? $this->armor[$i]->getID() - 256:0;
|
||||
}else{
|
||||
$this->armor[$i] = BlockAPI::getItem(AIR, 0, 0);
|
||||
$data["slot$i"] = 0;
|
||||
$data["slot$i"] = 255;
|
||||
}
|
||||
$armor[] = $this->armor[$i];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user