aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/loaders
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/loaders')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java3
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java51
2 files changed, 52 insertions, 2 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
index d4a25e03dd..da93fe212c 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_DustGeneration.java
@@ -46,9 +46,8 @@ public class RecipeGen_DustGeneration extends RecipeGen_Base {
}
private void generateRecipes(final Material material, final boolean disableOptional){
- final int tVoltageMultiplier = material.vVoltageMultiplier;
- Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName()); //TODO
+ Logger.WARNING("Generating Shaped Crafting recipes for "+material.getLocalizedName());
final ItemStack normalDust = material.getDust(1);
final ItemStack smallDust = material.getSmallDust(1);
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
new file mode 100644
index 0000000000..321cab4628
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/loaders/misc/AddCustomMachineToPA.java
@@ -0,0 +1,51 @@
+package gtPlusPlus.xmod.gregtech.loaders.misc;
+
+import java.lang.reflect.Method;
+
+import gregtech.api.util.Recipe_GT;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
+import gtPlusPlus.core.util.reflect.ReflectionUtils;
+
+public class AddCustomMachineToPA {
+
+ private static final boolean sDoesPatchExist;
+ private static final Class sManagerPA;
+ private static final Method sRegisterRecipeMapForMeta;
+
+ static {
+ sDoesPatchExist = ReflectionUtils.doesClassExist("gregtech.api.util.GT_ProcessingArray_Manager");
+ if (sDoesPatchExist) {
+ sManagerPA = ReflectionUtils.getClass("gregtech.api.util.GT_ProcessingArray_Manager");
+ sRegisterRecipeMapForMeta = ReflectionUtils.getMethod(sManagerPA, "registerRecipeMapForMeta", int.class, GT_Recipe_Map.class);
+ }
+ else {
+ sManagerPA = null;
+ sRegisterRecipeMapForMeta = null;
+ }
+ }
+
+ public static final void registerRecipeMapForID(int aID, GT_Recipe_Map aMap) {
+ if (sDoesPatchExist) {
+ ReflectionUtils.invokeNonBool(null, sRegisterRecipeMapForMeta, new Object[] {aID, aMap});
+ }
+
+ }
+
+ public static final void registerRecipeMapBetweenRangeOfIDs(int aMin, int aMax, GT_Recipe_Map aMap) {
+ if (sDoesPatchExist) {
+ for (int i=aMin; i<=aMax;i++) {
+ ReflectionUtils.invokeNonBool(null, sRegisterRecipeMapForMeta, new Object[] {i, aMap});
+ //GT_ProcessingArray_Manager.registerRecipeMapForMeta(i, aMap);
+ }
+ }
+ }
+
+ public static void register() {
+
+ // Simple Washers
+ registerRecipeMapForID(767, Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes);
+ registerRecipeMapBetweenRangeOfIDs(31017, 31020, Recipe_GT.Gregtech_Recipe_Map.sSimpleWasherRecipes);
+
+ }
+
+}