aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/gregtech
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
commitcbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch)
treeb85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/core/util/gregtech
parentc40416b036c0e89451e1558253ccf07bbee028d0 (diff)
downloadGT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/gregtech')
-rw-r--r--src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java74
1 files changed, 35 insertions, 39 deletions
diff --git a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
index 025b535e14..b10e643831 100644
--- a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
+++ b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java
@@ -1,56 +1,56 @@
package gtPlusPlus.core.util.gregtech.recipehandlers;
-import java.lang.reflect.Method;
-
import gregtech.api.util.GT_ModHandler;
import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
+
+import java.lang.reflect.Method;
+
import net.minecraft.item.ItemStack;
public final class GregtechRecipe {
public LibraryProxy ourProxy;
-
- public GregtechRecipe() {
+ public GregtechRecipe(){
Utils.LOG_INFO("Initializing a recipe handler for different versions of Gregtech 5.");
try {
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- this.ourProxy = new LibProxy1();
- Utils.LOG_INFO("Selecting GT 5.7/5.8 Recipe Set");
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ this.ourProxy = new LibProxy1();
+ Utils.LOG_INFO("Selecting GT 5.7/5.8 Recipe Set");
}
- if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- this.ourProxy = new LibProxy2();
- Utils.LOG_INFO("Selecting GT 5.9 Recipe Set");
+ if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK){
+ this.ourProxy = new LibProxy2();
+ Utils.LOG_INFO("Selecting GT 5.9 Recipe Set");
}
- }
- catch (final NoSuchMethodException e) {
+ } catch (NoSuchMethodException e) {
this.ourProxy = null;
}
}
- public boolean addSmeltingAndAlloySmeltingRecipe(final ItemStack aInput, final ItemStack aOutput) {
- Utils.LOG_WARNING("Adding a GT Furnace/Alloy Smelter Recipe" + "| Input:" + aInput.getDisplayName()
- + " | Output:" + aOutput.getDisplayName() + " |");
- return this.ourProxy.addSmeltingAndAlloySmeltingRecipe(aInput, aOutput);
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
+ Utils.LOG_WARNING("Adding a GT Furnace/Alloy Smelter Recipe"+"| Input:"+aInput.getDisplayName()+" | Output:"+aOutput.getDisplayName()+" |");
+ return ourProxy.addSmeltingAndAlloySmeltingRecipe(aInput, aOutput);
}
}
+abstract class LibraryProxy { // can also be interface unless you want to have common code here
+ abstract public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput);
+}
+
class LibProxy1 extends LibraryProxy {
final Method m1;
public LibProxy1() throws NoSuchMethodException {
- this.m1 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
- ItemStack.class);
+ m1 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class);
}
@Override
- public boolean addSmeltingAndAlloySmeltingRecipe(final ItemStack aInput, final ItemStack aOutput) {
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
try {
Utils.LOG_INFO("Trying with Gt 5.7/5.8 Method.");
- return (boolean) this.m1.invoke(null, aInput, aOutput);
- }
- catch (final Exception e) {
+ return (boolean) m1.invoke(null, aInput, aOutput);
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
@@ -60,32 +60,28 @@ class LibProxy2 extends LibraryProxy {
final Method m2;
public LibProxy2() throws NoSuchMethodException {
- this.m2 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
- ItemStack.class, boolean.class);
+ m2 = GT_ModHandler.class.getDeclaredMethod("addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class, boolean.class);
}
@Override
- public boolean addSmeltingAndAlloySmeltingRecipe(final ItemStack aInput, final ItemStack aOutput) {
+ public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput) {
try {
Utils.LOG_INFO("Trying with Gt 5.9 Method.");
- return (boolean) this.m2.invoke(null, aInput, aOutput, true);
- }
- catch (final Exception e) {
+ return (boolean) m2.invoke(null, aInput, aOutput, true);
+ } catch (Exception e) {
throw new RuntimeException(e);
}
}
}
-abstract class LibraryProxy { // can also be interface unless you want to have
- // common code here
- abstract public boolean addSmeltingAndAlloySmeltingRecipe(ItemStack aInput, ItemStack aOutput);
+/*class Lib { // v1
+ public static void addRecipe(ItemStack aInput, ItemStack aOutput) {
+ System.out.println("shit totally happened v1");
+ }
}
-/*
- * class Lib { // v1 public static void addRecipe(ItemStack aInput, ItemStack
- * aOutput) { System.out.println("shit totally happened v1"); } }
- *
- * class Lib2 { // v2 public static void addRecipe(ItemStack aInput, ItemStack
- * aOutput, boolean hidden) { System.out.println("shit totally happened v2"); }
- * }
- */ \ No newline at end of file
+class Lib2 { // v2
+ public static void addRecipe(ItemStack aInput, ItemStack aOutput, boolean hidden) {
+ System.out.println("shit totally happened v2");
+ }
+}*/ \ No newline at end of file