aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2019-02-07 09:09:36 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2019-02-07 09:09:36 +0000
commita7cf24d87bbe776018ffe0c5bb9a8436151ffad6 (patch)
treea79483a86d93b4f27665635fd9827075760cde56 /src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
parent0410038d093905b77e5cf943afe02291dd4eef0c (diff)
downloadGT5-Unofficial-a7cf24d87bbe776018ffe0c5bb9a8436151ffad6.tar.gz
GT5-Unofficial-a7cf24d87bbe776018ffe0c5bb9a8436151ffad6.tar.bz2
GT5-Unofficial-a7cf24d87bbe776018ffe0c5bb9a8436151ffad6.zip
$ Backwards compatibility.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java54
1 files changed, 38 insertions, 16 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
index 9068bf2ec1..63581af16c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/StaticFields59.java
@@ -5,7 +5,6 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -34,6 +33,7 @@ public class StaticFields59 {
public static final Field mDescriptionArray;
public static final Field mCasingTexturePages;
public static final Field mAssLineVisualMapNEI;
+ public static final GT_Recipe_Map sAssemblylineVisualRecipes;
public static final Method mCalculatePollutionReduction;
public static final Method mAddFurnaceRecipe;
@@ -44,29 +44,51 @@ public class StaticFields59 {
//OrePrefixes
static {
+ Logger.INFO("[SH] Creating Static Helper for various fields which require reflective access.");
mGtBlockCasings5 = getField(GregTech_API.class, "sBlockCasings5");
+ Logger.INFO("[SH] Got Field: sBlockCasings5");
mPreventableComponents = getField(OrePrefixes.class, "mPreventableComponents");
+ Logger.INFO("[SH] Got Field: mPreventableComponents");
mDisabledItems = getField(OrePrefixes.class, "mDisabledItems");
- mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
+ Logger.INFO("[SH] Got Field: mDisabledItems");
mDescriptionArray = getField(GT_MetaTileEntity_TieredMachineBlock.class, "mDescriptionArray");
+ Logger.INFO("[SH] Got Field: mDescriptionArray");
mCasingTexturePages = getField(BlockIcons.class, "casingTexturePages");
+ Logger.INFO("[SH] Got Field: casingTexturePages");
+
mAssLineVisualMapNEI = getField(GT_Recipe_Map.class, "sAssemblylineVisualRecipes");
-
- mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction", int.class);
-
- Logger.INFO("Initializing a recipe handler for different versions of Gregtech 5.");
- //Yep...
- if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
- Logger.INFO("Selecting GT 5.7/5.8 Recipe Set");
- mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class);
+ Logger.INFO("[SH] Got Field: mAssLineVisualMapNEI");
+ GT_Recipe_Map aTemp;
+ if (mAssLineVisualMapNEI != null) {
+ try {
+ aTemp = (GT_Recipe_Map) mAssLineVisualMapNEI.get(null);
+ Logger.INFO("[SH] Got Field: sAssemblylineVisualRecipes");
+ } catch (IllegalArgumentException | IllegalAccessException e) {
+ aTemp = null;
+ }
+ } else {
+ aTemp = null;
}
- else {
- Logger.INFO("Selecting GT 5.9 Recipe Set");
- mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class, ItemStack.class, boolean.class);
+
+ sAssemblylineVisualRecipes = aTemp;
+ mMultiblockChemicalRecipes = getField(GT_Recipe_Map.class, "sMultiblockChemicalRecipes");
+ Logger.INFO("[SH] Got Field: sMultiblockChemicalRecipes");
+
+ mCalculatePollutionReduction = getMethod(GT_MetaTileEntity_Hatch_Muffler.class, "calculatePollutionReduction",
+ int.class);
+ Logger.INFO("[SH] Got Method: calculatePollutionReduction");
+
+ // Yep...
+ if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) {
+ mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
+ ItemStack.class);
+ Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
+ } else {
+ mAddFurnaceRecipe = getMethod(GT_ModHandler.class, "addSmeltingAndAlloySmeltingRecipe", ItemStack.class,
+ ItemStack.class, boolean.class);
+ Logger.INFO("[SH] Got Method: addSmeltingAndAlloySmeltingRecipe");
}
-
-
-
+
}
public static synchronized final Block getBlockCasings5() {