Fix dataless crafting and furnace recipes

This commit is contained in:
Dylan K. Taylor 2016-10-28 12:17:11 +01:00
parent 2765e87677
commit 46af92f781
2 changed files with 2 additions and 2 deletions

View File

@ -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());

View File

@ -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));