diff --git a/src/pocketmine/entity/Human.php b/src/pocketmine/entity/Human.php index 8d4ed82c9..46f1e9106 100644 --- a/src/pocketmine/entity/Human.php +++ b/src/pocketmine/entity/Human.php @@ -485,7 +485,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ $slotCount = $this->inventory->getSize() + $this->inventory->getHotbarSize(); for($slot = $this->inventory->getHotbarSize(); $slot < $slotCount; ++$slot){ $item = $this->inventory->getItem($slot - 9); - if($item->getId() !== ItemItem::AIR){ + if(!$item->isNull()){ $this->namedtag->Inventory[$slot] = $item->nbtSerialize($slot); } } @@ -493,7 +493,7 @@ class Human extends Creature implements ProjectileSource, InventoryHolder{ //Armor for($slot = 100; $slot < 104; ++$slot){ $item = $this->inventory->getItem($this->inventory->getSize() + $slot - 100); - if($item instanceof ItemItem and $item->getId() !== ItemItem::AIR){ + if(!$item->isNull()){ $this->namedtag->Inventory[$slot] = $item->nbtSerialize($slot); } } diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/tile/Furnace.php index 31a5c5247..1aa8af256 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/tile/Furnace.php @@ -216,7 +216,7 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{ $raw = $this->inventory->getSmelting(); $product = $this->inventory->getResult(); $smelt = $this->server->getCraftingManager()->matchFurnaceRecipe($raw); - $canSmelt = ($smelt instanceof FurnaceRecipe and $raw->getCount() > 0 and (($smelt->getResult()->equals($product) and $product->getCount() < $product->getMaxStackSize()) or $product->getId() === Item::AIR)); + $canSmelt = ($smelt instanceof FurnaceRecipe and $raw->getCount() > 0 and (($smelt->getResult()->equals($product) and $product->getCount() < $product->getMaxStackSize()) or $product->isNull())); if($this->namedtag->BurnTime->getValue() <= 0 and $canSmelt and $fuel->getFuelTime() > 0 and $fuel->getCount() > 0){ $this->checkFuel($fuel);