Removes a Crafting Recipe. @param aOutput The output of the Recipe. @return if it has removed at least one Recipe.
(ItemStack aOutput, boolean aIgnoreNBT, boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers, boolean aDontRemoveDyeingRecipes)
| 601 | * @return if it has removed at least one Recipe. |
| 602 | */ |
| 603 | public static boolean remout(ItemStack aOutput, boolean aIgnoreNBT, boolean aNotRemoveShapelessRecipes, boolean aOnlyRemoveNativeHandlers, boolean aDontRemoveDyeingRecipes) { |
| 604 | if (ST.invalid(aOutput)) return F; |
| 605 | boolean rReturn = F; |
| 606 | List<IRecipe> tList = list(); |
| 607 | aOutput = OM.get_(aOutput); |
| 608 | for (int i = 0; i < tList.size(); i++) { |
| 609 | IRecipe tRecipe = tList.get(i); |
| 610 | if (tRecipe instanceof ICraftingRecipeGT && !((ICraftingRecipeGT)tRecipe).isRemovableByGT()) continue; |
| 611 | if (aNotRemoveShapelessRecipes && (tRecipe instanceof ShapelessRecipes || tRecipe instanceof ShapelessOreRecipe)) continue; |
| 612 | if (aOnlyRemoveNativeHandlers) { |
| 613 | if (!CLASSES_NATIVE.contains(tRecipe.getClass().getName())) continue; |
| 614 | } else { |
| 615 | if (CLASSES_SPECIAL.contains(tRecipe.getClass().getName())) continue; |
| 616 | } |
| 617 | if (!ST.equal(OM.get(tRecipe.getRecipeOutput()), aOutput, aIgnoreNBT)) continue; |
| 618 | if (aDontRemoveDyeingRecipes) { |
| 619 | if (tRecipe instanceof ShapedOreRecipe ) {boolean temp = F; for (Object tObject : ((ShapedOreRecipe )tRecipe).getInput()) if (OREDICT_DYE_LISTS.contains(tObject)) {temp = T; break;} if (temp) continue;} |
| 620 | if (tRecipe instanceof ShapelessOreRecipe) {boolean temp = F; for (Object tObject : ((ShapelessOreRecipe)tRecipe).getInput()) if (OREDICT_DYE_LISTS.contains(tObject)) {temp = T; break;} if (temp) continue;} |
| 621 | } |
| 622 | tList.remove(i--); |
| 623 | rReturn = T; |
| 624 | } |
| 625 | return rReturn; |
| 626 | } |
| 627 | |
| 628 | /** |
| 629 | * Removes a Crafting Recipe. |
no test coverage detected