From 46af92f78139807ecb874f304ca9a7a1335f9241 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 28 Oct 2016 12:17:11 +0100 Subject: [PATCH] Fix dataless crafting and furnace recipes --- src/pocketmine/network/protocol/CraftingDataPacket.php | 2 +- src/pocketmine/utils/BinaryStream.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/network/protocol/CraftingDataPacket.php b/src/pocketmine/network/protocol/CraftingDataPacket.php index edbec89a4..6699d03eb 100644 --- a/src/pocketmine/network/protocol/CraftingDataPacket.php +++ b/src/pocketmine/network/protocol/CraftingDataPacket.php @@ -90,7 +90,7 @@ class CraftingDataPacket extends DataPacket{ } private static function writeFurnaceRecipe(FurnaceRecipe $recipe, BinaryStream $stream){ - if($recipe->getInput()->getDamage() !== 0){ //Data recipe + if($recipe->getInput()->getDamage() !== null){ //Data recipe $stream->putVarInt($recipe->getInput()->getDamage()); $stream->putVarInt($recipe->getInput()->getId()); $stream->putSlot($recipe->getResult()); diff --git a/src/pocketmine/utils/BinaryStream.php b/src/pocketmine/utils/BinaryStream.php index adbe31876..6feb16f2e 100644 --- a/src/pocketmine/utils/BinaryStream.php +++ b/src/pocketmine/utils/BinaryStream.php @@ -233,7 +233,7 @@ class BinaryStream extends \stdClass{ } $this->putVarInt($item->getId()); - $auxValue = ($item->getDamage() << 8) | $item->getCount(); + $auxValue = (($item->getDamage() ?? -1) << 8) | $item->getCount(); $this->putVarInt($auxValue); $nbt = $item->getCompoundTag(); $this->putLShort(strlen($nbt));