We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c452f91 commit f9a2142Copy full SHA for f9a2142
src/main/java/net/swedz/tesseract/neoforge/compat/mi/helper/MachineRecipeHelper.java
@@ -0,0 +1,16 @@
1
+package net.swedz.tesseract.neoforge.compat.mi.helper;
2
+
3
+import aztech.modern_industrialization.machines.recipe.MachineRecipe;
4
+import aztech.modern_industrialization.machines.recipe.condition.MachineProcessCondition;
5
6
+public final class MachineRecipeHelper
7
+{
8
+ public static <T extends MachineProcessCondition> T getRecipeCondition(MachineRecipe recipe, Class<T> conditionType)
9
+ {
10
+ return recipe.conditions.stream()
11
+ .filter((c) -> conditionType.isAssignableFrom(c.getClass()))
12
+ .map((c) -> (T) c)
13
+ .findFirst()
14
+ .orElse(null);
15
+ }
16
+}
0 commit comments