Updated with ListTag changes from PocketMine-NBT

This commit is contained in:
Dylan K. Taylor
2018-02-07 18:14:58 +00:00
parent 4a85311c5f
commit 9abfd54cc1
8 changed files with 71 additions and 125 deletions

View File

@ -515,8 +515,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
foreach($inventoryTag as $i => $item){
$slot = $item->getByte("Slot");
if($slot >= 0 and $slot < 9){ //Hotbar
//Old hotbar saving stuff, remove it (useless now)
unset($inventoryTag[$i]);
//Old hotbar saving stuff, ignore it
}elseif($slot >= 100 and $slot < 104){ //Armor
$this->armorInventory->setItem($slot - 100, ItemItem::nbtDeserialize($item));
}else{
@ -647,7 +646,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
for($slot = $this->inventory->getHotbarSize(); $slot < $slotCount; ++$slot){
$item = $this->inventory->getItem($slot - 9);
if(!$item->isNull()){
$inventoryTag[$slot] = $item->nbtSerialize($slot);
$inventoryTag->push($item->nbtSerialize($slot));
}
}
@ -655,7 +654,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{
for($slot = 100; $slot < 104; ++$slot){
$item = $this->armorInventory->getItem($slot - 100);
if(!$item->isNull()){
$inventoryTag[$slot] = $item->nbtSerialize($slot);
$inventoryTag->push($item->nbtSerialize($slot));
}
}