From b2017c8462575e0c428292ccb6970c89795a2f74 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 18 Dec 2022 22:14:31 +0000 Subject: [PATCH] and more --- src/block/tile/ContainerTrait.php | 2 +- src/entity/Human.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/block/tile/ContainerTrait.php b/src/block/tile/ContainerTrait.php index 4c4907a9b..ecaa544d2 100644 --- a/src/block/tile/ContainerTrait.php +++ b/src/block/tile/ContainerTrait.php @@ -52,7 +52,7 @@ trait ContainerTrait{ $newContents = []; /** @var CompoundTag $itemNBT */ foreach($inventoryTag as $itemNBT){ - $newContents[$itemNBT->getByte("Slot")] = Item::nbtDeserialize($itemNBT); + $newContents[$itemNBT->getByte(Item::TAG_SLOT)] = Item::nbtDeserialize($itemNBT); } $inventory->setContents($newContents); diff --git a/src/entity/Human.php b/src/entity/Human.php index d75c38d9c..58911a07c 100644 --- a/src/entity/Human.php +++ b/src/entity/Human.php @@ -297,7 +297,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ /** @var CompoundTag $item */ foreach($inventoryTag as $i => $item){ - $slot = $item->getByte("Slot"); + $slot = $item->getByte(Item::TAG_SLOT); if($slot >= 0 && $slot < 9){ //Hotbar //Old hotbar saving stuff, ignore it }elseif($slot >= 100 && $slot < 104){ //Armor @@ -326,7 +326,7 @@ class Human extends Living implements ProjectileSource, InventoryHolder{ /** @var CompoundTag $item */ foreach($enderChestInventoryTag as $i => $item){ - $enderChestInventoryItems[$item->getByte("Slot")] = Item::nbtDeserialize($item); + $enderChestInventoryItems[$item->getByte(Item::TAG_SLOT)] = Item::nbtDeserialize($item); } self::populateInventoryFromListTag($this->enderInventory, $enderChestInventoryItems); }