aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2018-01-31 22:16:31 +1000
committerJordan Byrne <draknyte1@hotmail.com>2018-01-31 22:16:31 +1000
commit7a1c92118a53b5bc6294d65361e16c5859597a10 (patch)
tree2dba81c7d2eb78e48ceba687af6aaaa1de746289 /src/Java/gtPlusPlus/core
parentc793ff869c74bae8c35516042f5ae883aeb270c9 (diff)
downloadGT5-Unofficial-7a1c92118a53b5bc6294d65361e16c5859597a10.tar.gz
GT5-Unofficial-7a1c92118a53b5bc6294d65361e16c5859597a10.tar.bz2
GT5-Unofficial-7a1c92118a53b5bc6294d65361e16c5859597a10.zip
$ Finished ASM for getDrops() GT fix.
% Mild re-arrangement to CI.java.
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/common/CommonProxy.java4
-rw-r--r--src/Java/gtPlusPlus/core/recipe/common/CI.java94
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java8
3 files changed, 55 insertions, 51 deletions
diff --git a/src/Java/gtPlusPlus/core/common/CommonProxy.java b/src/Java/gtPlusPlus/core/common/CommonProxy.java
index 191f81cef5..6acdf9b0c3 100644
--- a/src/Java/gtPlusPlus/core/common/CommonProxy.java
+++ b/src/Java/gtPlusPlus/core/common/CommonProxy.java
@@ -78,7 +78,7 @@ public class CommonProxy {
//29/01/18 - Alkalus
ModItems.init();
ModBlocks.init();
- CI.Init();
+ CI.preInit();
}
@@ -88,6 +88,8 @@ public class CommonProxy {
if (CORE.DEBUG){
DEBUG_INIT.registerHandlers();
}
+
+ CI.init();
/**
* Register the Event Handlers.
diff --git a/src/Java/gtPlusPlus/core/recipe/common/CI.java b/src/Java/gtPlusPlus/core/recipe/common/CI.java
index f9dc105792..03bf3a6020 100644
--- a/src/Java/gtPlusPlus/core/recipe/common/CI.java
+++ b/src/Java/gtPlusPlus/core/recipe/common/CI.java
@@ -171,20 +171,7 @@ public class CI {
public static ItemStack explosiveTNT;
public static ItemStack explosiveITNT;
- public static void Init(){
-
- //Set Explosives
- if (ItemList.valueOf("Block_Powderbarrel") != null){
- explosivePowderKeg = ItemList.valueOf("Block_Powderbarrel").get(1);
- }
- else {
- explosivePowderKeg = ItemUtils.getSimpleStack(Items.gunpowder);
- }
- explosiveTNT = ItemUtils.getSimpleStack(Blocks.tnt);
- explosiveITNT = Ic2Items.industrialTnt.copy();
-
-
-
+ public static void preInit(){
//Tiered Components
component_Plate = new String[]{
@@ -241,39 +228,7 @@ public class CI {
circuitTier7 = getTieredCircuit(7);
circuitTier8 = getTieredCircuit(8);
circuitTier9 = getTieredCircuit(9);
-
- //Machine Components
- LOADER_Machine_Components.initialise();
-
- //Machine Casings
- machineCasing_ULV = ItemList.Casing_ULV.get(1);
- machineCasing_LV = ItemList.Casing_LV.get(1);
- machineCasing_MV = ItemList.Casing_MV.get(1);
- machineCasing_HV = ItemList.Casing_HV.get(1);
- machineCasing_EV = ItemList.Casing_EV.get(1);
- machineCasing_IV = ItemList.Casing_IV.get(1);
- machineCasing_LuV = ItemList.Casing_LuV.get(1);
- machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
- machineCasing_UV = ItemList.Casing_UV.get(1);
- machineCasing_MAX = ItemList.Casing_MAX.get(1);
-
- //Machine Hulls
- machineHull_ULV = ItemList.Hull_ULV.get(1);
- machineHull_LV = ItemList.Hull_LV.get(1);
- machineHull_MV = ItemList.Hull_MV.get(1);
- machineHull_HV = ItemList.Hull_HV.get(1);
- machineHull_EV = ItemList.Hull_EV.get(1);
- machineHull_IV = ItemList.Hull_IV.get(1);
- machineHull_LuV = ItemList.Hull_LuV.get(1);
- machineHull_ZPM = ItemList.Hull_ZPM.get(1);
- machineHull_UV = ItemList.Hull_UV.get(1);
- machineHull_MAX = ItemList.Hull_MAX.get(1);
-
- //Gear box Casings
- gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
- gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
- gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
- gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
+
}
public static Object getTieredCircuit(int tier){
@@ -500,5 +455,50 @@ public class CI {
return machineCasing_MAX;
}
}
+
+ public static void init() {
+ //Set Explosives
+ if (ItemList.valueOf("Block_Powderbarrel") != null){
+ explosivePowderKeg = ItemList.valueOf("Block_Powderbarrel").get(1);
+ }
+ else {
+ explosivePowderKeg = ItemUtils.getSimpleStack(Items.gunpowder);
+ }
+ explosiveTNT = ItemUtils.getSimpleStack(Blocks.tnt);
+ explosiveITNT = Ic2Items.industrialTnt.copy();
+
+ //Machine Casings
+ machineCasing_ULV = ItemList.Casing_ULV.get(1);
+ machineCasing_LV = ItemList.Casing_LV.get(1);
+ machineCasing_MV = ItemList.Casing_MV.get(1);
+ machineCasing_HV = ItemList.Casing_HV.get(1);
+ machineCasing_EV = ItemList.Casing_EV.get(1);
+ machineCasing_IV = ItemList.Casing_IV.get(1);
+ machineCasing_LuV = ItemList.Casing_LuV.get(1);
+ machineCasing_ZPM = ItemList.Casing_ZPM.get(1);
+ machineCasing_UV = ItemList.Casing_UV.get(1);
+ machineCasing_MAX = ItemList.Casing_MAX.get(1);
+
+ //Machine Hulls
+ machineHull_ULV = ItemList.Hull_ULV.get(1);
+ machineHull_LV = ItemList.Hull_LV.get(1);
+ machineHull_MV = ItemList.Hull_MV.get(1);
+ machineHull_HV = ItemList.Hull_HV.get(1);
+ machineHull_EV = ItemList.Hull_EV.get(1);
+ machineHull_IV = ItemList.Hull_IV.get(1);
+ machineHull_LuV = ItemList.Hull_LuV.get(1);
+ machineHull_ZPM = ItemList.Hull_ZPM.get(1);
+ machineHull_UV = ItemList.Hull_UV.get(1);
+ machineHull_MAX = ItemList.Hull_MAX.get(1);
+
+ //Gear box Casings
+ gearboxCasing_Tier_1 = ItemList.Casing_Gearbox_Bronze.get(1);
+ gearboxCasing_Tier_2 = ItemList.Casing_Gearbox_Steel.get(1);
+ gearboxCasing_Tier_3 = ItemList.Casing_Gearbox_Titanium.get(1);
+ gearboxCasing_Tier_4 = ItemList.Casing_Gearbox_TungstenSteel.get(1);
+
+ //Machine Components
+ LOADER_Machine_Components.initialise();
+ }
}
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 2a98f0a75a..a0968fd5c1 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -16,14 +16,16 @@ public class ReflectionUtils {
public static Field getField(final Class clazz, final String fieldName) throws NoSuchFieldException {
try {
- return clazz.getDeclaredField(fieldName);
+ Field k = clazz.getDeclaredField(fieldName);
+ makeAccessible(k);
+ return k;
} catch (final NoSuchFieldException e) {
final Class<?> superClass = clazz.getSuperclass();
if (superClass == null) {
- //Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+".");
+ Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+".");
throw e;
}
- //Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+". Trying super class.");
+ Logger.REFLECTION("Failed to get Field from Class. "+fieldName+" does not existing within "+clazz.getCanonicalName()+". Trying super class.");
return getField(superClass, fieldName);
}
}