mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Fix dataless crafting and furnace recipes
This commit is contained in:
parent
2765e87677
commit
46af92f781
@ -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());
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user