MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / remove

Method remove

src/main/java/gregapi/util/CR.java:675–687  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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}

Callers 15

onModPreInit2Method · 0.95
rem_smeltingMethod · 0.95
removeRecipeMethod · 0.95
removeMethod · 0.95
shapedMethod · 0.95
shapelessMethod · 0.95
onModPostInit2Method · 0.95
onModServerStarting2Method · 0.95
onPostLoadMethod · 0.95
onPostLoadMethod · 0.95
onPostLoadMethod · 0.95
onPostLoadMethod · 0.95

Calls 9

hasValidMethod · 0.95
craftingMethod · 0.95
listMethod · 0.95
getMethod · 0.65
isRemovableByGTMethod · 0.65
removeMethod · 0.65
sizeMethod · 0.45
matchesMethod · 0.45
getCraftingResultMethod · 0.45

Tested by

no test coverage detected