diff --git a/src/API/PlayerAPI.php b/src/API/PlayerAPI.php index 8ce489dd2c..9c5876e82b 100644 --- a/src/API/PlayerAPI.php +++ b/src/API/PlayerAPI.php @@ -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" => "", diff --git a/src/Player.php b/src/Player.php index 8a6f0498ae..3405cd0073 100644 --- a/src/Player.php +++ b/src/Player.php @@ -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]; }