diff --git a/src/pocketmine/inventory/CraftingManager.php b/src/pocketmine/inventory/CraftingManager.php index 7c05292e6..2c8cbc78f 100644 --- a/src/pocketmine/inventory/CraftingManager.php +++ b/src/pocketmine/inventory/CraftingManager.php @@ -390,6 +390,7 @@ class CraftingManager{ } } } + if(count($checkInput) === 0){ $hasRecipe = $recipe; break; diff --git a/src/pocketmine/item/Block.php b/src/pocketmine/item/Block.php index 80e7378b7..b8b61ddaa 100644 --- a/src/pocketmine/item/Block.php +++ b/src/pocketmine/item/Block.php @@ -33,7 +33,7 @@ class Block extends Item{ } public function setDamage($meta){ - $this->meta = $meta & 0x0F; + $this->meta = $meta !== null ? $meta & 0xFF : null; $this->block->setDamage($this->meta); } diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index aeff008a8..1d9e51ae5 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -26,10 +26,10 @@ namespace pocketmine\item; use pocketmine\block\Block; use pocketmine\entity\Entity; +use pocketmine\inventory\Fuel; use pocketmine\item\Block as ItemBlock; use pocketmine\level\Level; use pocketmine\Player; -use pocketmine\recipes\Fuel; class Item{ //All Block IDs are here too @@ -440,7 +440,6 @@ class Item{ }else{ $item = new Item($id, $meta, $count); } - return $item; } @@ -587,7 +586,7 @@ class Item{ } final public function __toString(){ - return "Item " . $this->name . " (" . $this->id . ":" . $this->meta . ")"; + return "Item " . $this->name . " (" . $this->id . ":" . ($this->meta === null ? "?" : $this->meta) . ")"; } public function getDestroySpeed(Block $block, Player $player){