aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/recipes
diff options
context:
space:
mode:
authorJordan Byrne <draknyte1@hotmail.com>2017-12-07 16:31:29 +1000
committerJordan Byrne <draknyte1@hotmail.com>2017-12-07 16:31:29 +1000
commitc964170c46c7242097fcd3076ba61a7851191472 (patch)
tree81eb22545824445311f35eccc02b5f0a65f40e6c /src/Java/gtPlusPlus/xmod/gregtech/recipes
parentdd5b8fefd5901d89982bb98455460900ccab6a7c (diff)
downloadGT5-Unofficial-c964170c46c7242097fcd3076ba61a7851191472.tar.gz
GT5-Unofficial-c964170c46c7242097fcd3076ba61a7851191472.tar.bz2
GT5-Unofficial-c964170c46c7242097fcd3076ba61a7851191472.zip
+ Added the component assembler. (Makes Motors, Pistons, etc.)
% More Nitro work.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/recipes')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
index 795d1762ba..ae05fdcaa4 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java
@@ -5,6 +5,7 @@ import gregtech.api.enums.Materials;
import gregtech.api.util.CustomRecipeMap;
import gregtech.api.util.GT_Recipe;
import gregtech.api.util.Recipe_GT;
+import gregtech.common.GT_RecipeAdder;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.item.ItemUtils;
import gtPlusPlus.xmod.gregtech.api.interfaces.internal.IGregtech_RecipeAdder;
@@ -393,5 +394,55 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder {
new FluidStack[] { aFluidOutput }, aDuration, aEUt, 0);
return true;
}
+
+ //Machine Component Assembler
+ public boolean addComponentMakerRecipe(ItemStack[] aInputs, FluidStack aFluidInput, ItemStack aOutput1, int aDuration, int aEUt) {
+ if (areItemsAndFluidsBothNull(aInputs, new FluidStack[]{aFluidInput})) {
+ return false;
+ }
+ if (aOutput1 == null) {
+ return false;
+ }
+ if ((aDuration = GregTech_API.sRecipeFile.get("machinecomponents", aOutput1, aDuration)) <= 0) {
+ return false;
+ }
+ Recipe_GT.Gregtech_Recipe_Map.sComponentAssemblerRecipes.addRecipe(true, aInputs, new ItemStack[]{aOutput1}, null, new FluidStack[]{aFluidInput}, null, aDuration, aEUt, 0);
+ return true;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ private boolean areItemsAndFluidsBothNull(final ItemStack[] items, final FluidStack[] fluids) {
+ boolean itemsNull = true;
+ if (items != null) {
+ for (final ItemStack itemStack : items) {
+ if (itemStack != null) {
+ itemsNull = false;
+ break;
+ }
+ }
+ }
+ boolean fluidsNull = true;
+ if (fluids != null) {
+ for (final FluidStack fluidStack : fluids) {
+ if (fluidStack != null) {
+ fluidsNull = false;
+ break;
+ }
+ }
+ }
+ return itemsNull && fluidsNull;
+ }
+
}