diff options
author | John <Techlone@users.noreply.github.com> | 2017-03-17 01:19:18 +0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-17 01:19:18 +0500 |
commit | 2a80f9d4a6ab16213ed2c1d96e2a1b3c90a538e1 (patch) | |
tree | e1435dee357acfabf79ad937a9c90d68e817f653 /src/main/java/gregtech/api | |
parent | 7e83c04210d507146248fc6f7d7cb6e7f6605824 (diff) | |
parent | f4dae834dacbac9d765ad597681a53fc067da674 (diff) | |
download | GT5-Unofficial-2a80f9d4a6ab16213ed2c1d96e2a1b3c90a538e1.tar.gz GT5-Unofficial-2a80f9d4a6ab16213ed2c1d96e2a1b3c90a538e1.tar.bz2 GT5-Unofficial-2a80f9d4a6ab16213ed2c1d96e2a1b3c90a538e1.zip |
Merge pull request #12 from Blood-Asp/unstable
Update
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r-- | src/main/java/gregtech/api/GregTech_API.java | 3 | ||||
-rw-r--r-- | src/main/java/gregtech/api/util/GT_Recipe.java | 24 |
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>(); |