Removes a Crafting Recipe and gives you the former output of it. @param aRecipe The content of the Crafting Grid as ItemStackArray with length 9 @return the output of the old Recipe or null if there was nothing.
(ItemStack... aRecipe)
| 673 | * @return the output of the old Recipe or null if there was nothing. |
| 674 | */ |
| 675 | public static ItemStack remove(ItemStack... aRecipe) { |
| 676 | if (!ST.hasValid(aRecipe)) return null; |
| 677 | ItemStack rReturn = null, tReturn = null; |
| 678 | InventoryCrafting aCrafting = crafting(aRecipe); |
| 679 | List<IRecipe> tList = list(); |
| 680 | for (int i = 0; i < tList.size(); i++) {try {for (; i < tList.size(); i++) { |
| 681 | if ((!(tList.get(i) instanceof ICraftingRecipeGT) || ((ICraftingRecipeGT)tList.get(i)).isRemovableByGT()) && tList.get(i).matches(aCrafting, CS.DW)) { |
| 682 | tReturn = tList.get(i).getCraftingResult(aCrafting); |
| 683 | if (tReturn != null) {rReturn = tReturn; tList.remove(i--);} |
| 684 | } |
| 685 | }} catch(Throwable e) {e.printStackTrace(ERR);}} |
| 686 | return rReturn; |
| 687 | } |
| 688 | } |
no test coverage detected