aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/GregTech_API.java3
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java24
2 files changed, 25 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/GregTech_API.java b/src/main/java/gregtech/api/GregTech_API.java
index de21d02f2e..6318ff936d 100644
--- a/src/main/java/gregtech/api/GregTech_API.java
+++ b/src/main/java/gregtech/api/GregTech_API.java
@@ -197,6 +197,9 @@ public class GregTech_API {
public static boolean mMagneticraft = false;
public static boolean mImmersiveEngineering = false;
public static boolean mGTPlusPlus = false;
+
+ public static boolean mUseOnlyGoodSolderingMaterials = false;
+
private static final String aTextIC2Lower = MOD_ID_IC2.toLowerCase(Locale.ENGLISH);
/**
* Getting assigned by the Mod loading
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index d509e6afe3..30874b2897 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -33,7 +33,7 @@ import static gregtech.api.enums.GT_Values.*;
* <p/>
* I know this File causes some Errors, because of missing Main Functions, but if you just need to compile Stuff, then remove said erroreous Functions.
*/
-public class GT_Recipe {
+public class GT_Recipe implements Comparable<GT_Recipe> {
public static volatile int VERSION = 509;
/**
* If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs, please add a new Recipe, because of the HashMaps.
@@ -412,7 +412,27 @@ public class GT_Recipe {
return true;
}
-
+ @Override
+ public int compareTo(GT_Recipe recipe) {
+ // first lowest tier recipes
+ // then fastest
+ // then with lowest special value
+ // then dry recipes
+ // then with fewer inputs
+ if (this.mEUt != recipe.mEUt) {
+ return this.mEUt - recipe.mEUt;
+ } else if (this.mDuration != recipe.mDuration) {
+ return this.mDuration - recipe.mDuration;
+ } else if (this.mSpecialValue != recipe.mSpecialValue) {
+ return this.mSpecialValue - recipe.mSpecialValue;
+ } else if (this.mFluidInputs.length != recipe.mFluidInputs.length) {
+ return this.mFluidInputs.length - recipe.mFluidInputs.length;
+ } else if (this.mInputs.length != recipe.mInputs.length) {
+ return this.mInputs.length - recipe.mInputs.length;
+ }
+ return 0;
+ }
+
public static class GT_Recipe_AssemblyLine{
public static final ArrayList<GT_Recipe_AssemblyLine> sAssemblylineRecipes = new ArrayList<GT_Recipe_AssemblyLine>();