mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 22:45:28 +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){
|
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()->getDamage());
|
||||||
$stream->putVarInt($recipe->getInput()->getId());
|
$stream->putVarInt($recipe->getInput()->getId());
|
||||||
$stream->putSlot($recipe->getResult());
|
$stream->putSlot($recipe->getResult());
|
||||||
|
@ -233,7 +233,7 @@ class BinaryStream extends \stdClass{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->putVarInt($item->getId());
|
$this->putVarInt($item->getId());
|
||||||
$auxValue = ($item->getDamage() << 8) | $item->getCount();
|
$auxValue = (($item->getDamage() ?? -1) << 8) | $item->getCount();
|
||||||
$this->putVarInt($auxValue);
|
$this->putVarInt($auxValue);
|
||||||
$nbt = $item->getCompoundTag();
|
$nbt = $item->getCompoundTag();
|
||||||
$this->putLShort(strlen($nbt));
|
$this->putLShort(strlen($nbt));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user