aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2017-07-11 22:01:19 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2017-07-11 22:01:19 +1000
commit7b0378b06e28702379f8fd3ce67d0ed93537ddf1 (patch)
treeff79b12165ffe5b8a340d3c0fef2f38f931277d0 /src/Java/gtPlusPlus/core
parentfd46163f7afe8b45f2b965c1bcb242ea0c6cbf78 (diff)
downloadGT5-Unofficial-7b0378b06e28702379f8fd3ce67d0ed93537ddf1.tar.gz
GT5-Unofficial-7b0378b06e28702379f8fd3ce67d0ed93537ddf1.tar.bz2
GT5-Unofficial-7b0378b06e28702379f8fd3ce67d0ed93537ddf1.zip
+ Added a few more circuit recipes to make compatibility 100%.
+ Tried adding a way to empty the Circuit Assembler recipe map.
Diffstat (limited to 'src/Java/gtPlusPlus/core')
-rw-r--r--src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java5
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java38
2 files changed, 41 insertions, 2 deletions
diff --git a/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java b/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
index b6343ececf..bf5f6dfdd8 100644
--- a/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
+++ b/src/Java/gtPlusPlus/core/recipe/RECIPES_Old_Circuits.java
@@ -26,9 +26,8 @@ public class RECIPES_Old_Circuits implements IOreRecipeRegistrator {
GT_Values.RA.addLaserEngraverRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Emerald, 1L), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]), 256, 480);
}
- else if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString())) {
+ else if (aOreDictName.equals(OreDictNames.craftingLensBlue.toString()) || aOreDictName.equals(OreDictNames.craftingLensCyan.toString()) || aOreDictName.equals(OreDictNames.craftingLensLightBlue.toString())) {
GT_Values.RA.addLaserEngraverRecipe(ItemList.IC2_LapotronCrystal.getWildcard(1L, new Object[0]), GT_Utility.copyAmount(0L, new Object[]{aStack}), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]), 256, 480);
-
}
}
@@ -60,12 +59,14 @@ public class RECIPES_Old_Circuits implements IOreRecipeRegistrator {
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Advanced.get(2L, new Object[0]), tMat.getMolten(144L * tMultiplier / 2L), GregtechItemList.Old_Circuit_Advanced.get(1L, new Object[0]), 32, 64);
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Advanced.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(1L, new Object[0]), tMat.getMolten(144L * tMultiplier / 2L), GregtechItemList.Old_Circuit_Data.get(1L, new Object[0]), 32, 64);
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Data.get(3L, new Object[0]), tMat.getMolten(144L * tMultiplier / 1L), GregtechItemList.Old_Circuit_Elite.get(1L, new Object[0]), 32, 256);
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), ItemList.Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]), tMat.getMolten(144L * tMultiplier / 1L), GregtechItemList.Old_Circuit_Master.get(1L, new Object[0]), 32, 256);
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Board_Elite.get(1L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(3L, new Object[0]), tMat.getMolten(144L * tMultiplier / 1L), GregtechItemList.Old_Circuit_Master.get(1L, new Object[0]), 32, 256);
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Data.get(1L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 2L), tMat.getMolten(144L * tMultiplier / 2L), GregtechItemList.Old_Tool_DataStick.get(1L, new Object[0]), 128, 64);
}
}
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Elite.get(2L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Elite.get(18L, new Object[0]), GT_Values.NF, GregtechItemList.Old_Tool_DataOrb.get(1L, new Object[0]), 512, 256);
+ GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Master.get(2L, new Object[0]), ItemList.Circuit_Parts_Crystal_Chip_Master.get(18L, new Object[0]), GT_Values.NF, ItemList.Energy_LapotronicOrb.get(1L, new Object[0]), 512, 1024);
GT_Values.RA.addAssemblerRecipe(GregtechItemList.Old_Circuit_Master.get(2L, new Object[0]), GregtechItemList.Old_Circuit_Parts_Crystal_Chip_Master.get(18L, new Object[0]), GT_Values.NF, ItemList.Energy_LapotronicOrb.get(1L, new Object[0]), 512, 1024);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 1L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Plastic, 1L), GregtechItemList.Old_Empty_Board_Basic.get(1L, new Object[0]), 32, 16);
GT_Values.RA.addAssemblerRecipe(GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Silicon, 2L), GT_OreDictUnificator.get(OrePrefixes.plate, Materials.Polytetrafluoroethylene, 1L), GregtechItemList.Old_Empty_Board_Elite.get(1L, new Object[0]), 32, 256);
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 88059acb49..ba48892112 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -97,5 +97,43 @@ public class ReflectionUtils {
//System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName());
return ste[depth].getMethodName();
}
+
+
+ /**
+ * Allows to change the state of an immutable instance. Huh?!?
+ */
+ public static void setFieldValue(Class clazz, String fieldName, Object newValue) throws Exception {
+ Field nameField = clazz.getDeclaredField(fieldName);
+ setValue(clazz, nameField, newValue);
+ }
+
+ /**
+ * Allows to change the state of final statics. Huh?!?
+ */
+ public static void setDefault(Class clazz, String fieldName, Object newValue) throws Exception {
+ Field staticField = clazz.getDeclaredField(fieldName);
+ setValue(null, staticField, newValue);
+ }
+
+ /**
+ *
+ * Set the value of a field reflectively.
+ */
+ protected static void setValue(Object owner, Field field, Object value) throws Exception {
+ makeModifiable(field);
+ field.set(owner, value);
+ }
+
+ /**
+ * Force the field to be modifiable and accessible.
+ */
+ protected static void makeModifiable(Field nameField) throws Exception {
+ nameField.setAccessible(true);
+ int modifiers = nameField.getModifiers();
+ Field modifierField = nameField.getClass().getDeclaredField("modifiers");
+ modifiers = modifiers & ~Modifier.FINAL;
+ modifierField.setAccessible(true);
+ modifierField.setInt(nameField, modifiers);
+ }
}