425 if(!isset($this->recipeLookup[$idx = $recipe->getResult()->getId() .
":" . $recipe->getResult()->getDamage()])){
429 $ingredients = $recipe->getIngredientList();
430 usort($ingredients, [$this,
"sort"]);
431 foreach($ingredients as $item){
432 $hash .= $item->getId() .
":" . ($item->hasAnyDamageValue() ?
"?" : $item->getDamage()) .
"x" . $item->getCount() .
",";
434 if(isset($this->recipeLookup[$idx][$hash])){
438 foreach($this->recipeLookup[$idx] as $recipe){
439 if($recipe instanceof ShapelessRecipe){
440 if($recipe->getIngredientCount() !== count($ingredients)){
443 $checkInput = $recipe->getIngredientList();
444 foreach($ingredients as $item){
445 $amount = $item->getCount();
446 foreach($checkInput as $k => $checkItem){
447 if($checkItem->equals($item, !$checkItem->hasAnyDamageValue(), $checkItem->hasCompoundTag())){
448 $remove = min($checkItem->getCount(), $amount);
449 $checkItem->setCount($checkItem->getCount() - $remove);
450 if($checkItem->getCount() === 0){
451 unset($checkInput[$k]);
460 if(count($checkInput) === 0){
461 $hasRecipe = $recipe;
465 if($hasRecipe instanceof Recipe){
469 return $hasRecipe !== null;