From c1f79fa2f82f755fca923e76bc82796e5bc347c6 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Thu, 6 Jun 2013 19:51:24 +0200 Subject: [PATCH] Fixed craftin recipes with wildcard --- src/Player.php | 5 +---- src/recipes/CraftingRecipes.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Player.php b/src/Player.php index 4260da0e0..f885711df 100644 --- a/src/Player.php +++ b/src/Player.php @@ -1479,7 +1479,7 @@ class Player{ $use = BlockAPI::getItem($slot->getID(), $slot->getMetadata(), $slot->count - $data["stack"]); $this->craftingItems[$data["slot"]] = $use; $craft = true; - }elseif($slot->count <= $data["stack"] and ($slot->getID() === AIR or $slot->getID() === $data["block"])){ //Crafting final + }elseif($slot->count <= $data["stack"] and ($slot->getID() === AIR or ($slot->getID() === $data["block"] and $slot->getMetadata() === $data["meta"]))){ //Crafting final $craftItem = BlockAPI::getItem($data["block"], $data["meta"], $data["stack"] - $slot->count); if(count($this->toCraft) === 0){ $this->toCraft[-1] = 0; @@ -1503,9 +1503,6 @@ class Player{ if($craft === true and count($this->craftingItems) > 0 and count($this->toCraft) > 0 and ($recipe = $this->craftItems($this->toCraft, $this->craftingItems, $this->toCraft[-1])) !== true){ if($recipe === false){ - $this->dataPacket(MC_CONTAINER_CLOSE, array( - "windowid" => 0, - )); $this->sendInventory(); $this->toCraft = array(); }else{ diff --git a/src/recipes/CraftingRecipes.php b/src/recipes/CraftingRecipes.php index 87dc5ee49..82a985e4a 100644 --- a/src/recipes/CraftingRecipes.php +++ b/src/recipes/CraftingRecipes.php @@ -268,7 +268,7 @@ class CraftingRecipes{ break; } $oitem = $recipeItems[$item[0]]; - if(($oitem[1] != $item[1] and $item[2] !== false) or $oitem[2] != $item[2]){ + if(($oitem[1] != $item[1] and $item[1] !== false) or $oitem[2] != $item[2]){ $continue = false; break; }