aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus')
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java b/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
index 19c09a8c21..98dfbf1f96 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/AddGregtechRecipe.java
@@ -3,6 +3,8 @@ package gtPlusPlus.core.util.reflect;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import gregtech.api.enums.GT_Values;
+import gregtech.api.interfaces.internal.IGT_RecipeAdder;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
@@ -12,15 +14,16 @@ public final class AddGregtechRecipe {
final FluidStack p4, final int p5, final int p6){
try {
- Class<?> GT_RecipeAdder = Class.forName("gregtech.common.GT_RecipeAdder");
- if (GT_RecipeAdder != null){
- Method addPollution = GT_RecipeAdder.getMethod("addPyrolyseRecipe", ItemStack.class, FluidStack.class, int.class, ItemStack.class, FluidStack.class, int.class, int.class);
- if (addPollution != null){
- return (boolean) addPollution.invoke(p0, p1, p2, p3, p4, p5, p6);
+ IGT_RecipeAdder IGT_RecipeAdder = GT_Values.RA;
+ if (IGT_RecipeAdder != null){
+ Class classRA = IGT_RecipeAdder.getClass();
+ Method addRecipe = classRA.getMethod("addPyrolyseRecipe", ItemStack.class, FluidStack.class, int.class, ItemStack.class, FluidStack.class, int.class, int.class);
+ if (addRecipe != null){
+ return (boolean) addRecipe.invoke(IGT_RecipeAdder, p0, p1, p2, p3, p4, p5, p6);
}
}
}
- catch (ClassNotFoundException | SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ catch (SecurityException | NoSuchMethodException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
return false;
}
return false;