Fixed derp x3

This commit is contained in:
Shoghi Cervantes 2014-03-04 19:49:39 +01:00
parent c6c0b75eae
commit 5241d8ff13
2 changed files with 6 additions and 2 deletions

View File

@ -467,7 +467,7 @@ class Player extends PlayerEntity{
//Normal inventory
$slotCount = (($this->gamemode & 0x01) === 0 ? PLAYER_SURVIVAL_SLOTS:PLAYER_CREATIVE_SLOTS) + 9;
for($slot = 9; $slot < $slotCount; ++$slot){
$item = $this->getSlot($count);
$item = $this->getSlot($slot);
$this->namedtag->Inventory[$slot] = new NBTTag_Compound(false, array(
"Count" => new NBTTag_Byte("Count", $item->getCount()),
"Damage" => new NBTTag_Short("Damage", $item->getMetadata()),

View File

@ -215,7 +215,11 @@ class HumanEntity extends CreatureEntity implements ProjectileSourceEntity, Inve
}
public function getSlot($slot){
$this->inventory[(int) $slot] = $item;
$slot = (int) $slot;
if(!($this->inventory[$slot] instanceof Item)){
$this->inventory[$slot] = BlockAPI::getItem(AIR, 0, 0);
}
return $this->inventory[$slot];
}
public function getAllSlots(){