diff options
author | Matt <mtthw8198@gmail.com> | 2021-06-01 14:18:25 -0700 |
---|---|---|
committer | Matt <mtthw8198@gmail.com> | 2021-06-01 14:18:25 -0700 |
commit | f87217e9a044b0f017d4b821017f697ca6568f42 (patch) | |
tree | aad0a14640e146837c950157750e3ad6cca88ea5 /src/main/java/gregtech/api/util/GT_ModHandler.java | |
parent | 08aa6a7f525eea881a00331bc75f055c3d275c3e (diff) | |
parent | 9555f77feccabf92d3bcc20c985c2060e2455600 (diff) | |
download | GT5-Unofficial-f87217e9a044b0f017d4b821017f697ca6568f42.tar.gz GT5-Unofficial-f87217e9a044b0f017d4b821017f697ca6568f42.tar.bz2 GT5-Unofficial-f87217e9a044b0f017d4b821017f697ca6568f42.zip |
Merge remote-tracking branch 'origin/experimental' into experimental
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_ModHandler.java')
-rw-r--r-- | src/main/java/gregtech/api/util/GT_ModHandler.java | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index 484e4d29b9..f82b0ecb7e 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -63,6 +63,7 @@ import java.util.stream.Collectors; import static gregtech.GT_Mod.GT_FML_LOGGER; import static gregtech.api.enums.GT_Values.B; + import static gregtech.api.enums.GT_Values.D1; import static gregtech.api.enums.GT_Values.DW; import static gregtech.api.enums.GT_Values.E; @@ -1332,6 +1333,7 @@ public class GT_ModHandler { delayedRemovalByRecipe.add(aCrafting); } + @SuppressWarnings("unchecked") public static void bulkRemoveByRecipe(List<InventoryCrafting> toRemove) { ArrayList<IRecipe> tList = (ArrayList<IRecipe>) CraftingManager.getInstance().getRecipeList(); GT_FML_LOGGER.info("BulkRemoveByRecipe: tList: " + tList.size() + " toRemove: " + toRemove.size() ); @@ -1483,14 +1485,23 @@ public class GT_ModHandler { * Used for Recipe Detection. */ public static ItemStack getRecipeOutput(ItemStack... aRecipe) { - return getRecipeOutput(false, aRecipe); + return getRecipeOutput(false, true, aRecipe); } - + + public static ItemStack getRecipeOutputNoOreDict(ItemStack... aRecipe) { + return getRecipeOutput(false,false, aRecipe); + } + + public static ItemStack getRecipeOutput(boolean aUncopiedStack, ItemStack... aRecipe) { + return getRecipeOutput(aUncopiedStack, true, aRecipe); + } + /** * Gives you a copy of the Output from a Crafting Recipe * Used for Recipe Detection. */ - public static ItemStack getRecipeOutput(boolean aUncopiedStack, ItemStack... aRecipe) { + @SuppressWarnings("unchecked") + public static ItemStack getRecipeOutput(boolean aUncopiedStack, boolean allowOreDict, ItemStack... aRecipe) { if (aRecipe == null || Arrays.stream(aRecipe).noneMatch(Objects::nonNull)) return null; InventoryCrafting aCrafting = new InventoryCrafting(new Container() { @@ -1505,6 +1516,8 @@ public class GT_ModHandler { for (IRecipe iRecipe : tList) { found = false; + if (!allowOreDict && iRecipe instanceof ShapedOreRecipe) continue; + try { found = iRecipe.matches(aCrafting, DW); } catch (Throwable e) { |