diff --git a/src/Player.php b/src/Player.php index 038bcbf5..d93cac6a 100755 --- a/src/Player.php +++ b/src/Player.php @@ -3968,7 +3968,7 @@ class Player{ } - $cc = CraftingRecipes::canCraft($results, $ingridients, $this->craftingType); + $cc = CraftingRecipes::canCraft($results, $ingridients, $this->craftingType, $this->PROTOCOL); if(!is_array($cc)){ if(!$cc){ $this->toCraft = []; diff --git a/src/recipes/CraftingRecipes.php b/src/recipes/CraftingRecipes.php index fc6c8124..e84816de 100644 --- a/src/recipes/CraftingRecipes.php +++ b/src/recipes/CraftingRecipes.php @@ -901,7 +901,7 @@ class CraftingRecipes{ * @param int $type craft type (CraftingRecipes::TYPE_INVENTORY, CraftingRecipes::TYPE_CRAFTIGTABLE, CraftingRecipes::TYPE_STONECUTTER) * @return array|true|false recipe that will be used or bool. If returned false, crafting will be aborted. If returned true crafting wont be aborted */ - public static function canCraft(array $craftItems, array $recipeItems, $type){ + public static function canCraft(array $craftItems, array $recipeItems, $type, $protocol = ProtocolInfo::CURRENT_PROTOCOL){ $craftIndexArr = []; foreach($craftItems as $it){ $craftIndexArr[$it[0]] = "{$it[0]}:{$it[1]}x{$it[2]}"; @@ -937,6 +937,20 @@ class CraftingRecipes{ ConsoleAPI::info("Recipe with $craftIndex is not found but it might be found later. Crafting continued."); return true; //recipe might be found next time } + if($protocol <= ProtocolInfo12::CURRENT_PROTOCOL_12 && $protocol >= ProtocolInfo12::CURRENT_PROTOCOL_11 && ($craftIndex === "5:0x4" || $craftIndex === "53:0x4" || $craftIndex === "158:0x6")){ + console(2); + switch ($craftIndex){ + case "5:0x4": + $arr[$craftIndex][][] = [WOOD, "?", 1]; + break; + case "53:0x4": + $arr[$craftIndex][][] = [WOODEN_PLANKS, "?", 6]; + break; + case "158:0x6": + $arr[$craftIndex][][] = [WOODEN_PLANKS, "?", 3]; + break; + } + } foreach($arr[$craftIndex] as $ingridients){ foreach($ingridients as $item){