From 402fc087ca1e4697d6ba6e6659ad296175f8a25b Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 4 Jul 2013 20:40:35 +0200 Subject: [PATCH] Armor fix --- src/Player.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Player.php b/src/Player.php index 12ddb6434..ac0a22bbb 100644 --- a/src/Player.php +++ b/src/Player.php @@ -1701,20 +1701,22 @@ class Player{ "player" => $this, "eid" => $this->eid ); + $armor = array(); for($i = 0; $i < 4; ++$i){ - if($this->armor[$i] instanceof Item){ + if(isset($this->armor[$i]) and ($this->armor[$i] instanceof Item)){ $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; } + $armor[] = $this->armor[$i]; } if($player instanceof Player){ if($player === $this){ $this->dataPacket(MC_CONTAINER_SET_CONTENT, array( "windowid" => 0x78, "count" => 4, - "slots" => $this->armor, + "slots" => $armor, )); }else{ $player->dataPacket(MC_PLAYER_ARMOR_EQUIPMENT, $data);