mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Updated with ListTag changes from PocketMine-NBT
This commit is contained in:
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user