2015-06-23 15:29:05 -07:00
package gregtech.common ;
2017-06-10 11:05:27 +02:00
import cpw.mods.fml.common.Loader ;
2015-06-23 15:29:05 -07:00
import gregtech.GT_Mod ;
import gregtech.api.GregTech_API ;
2017-04-22 19:08:47 +02:00
import gregtech.api.enums.GT_Values ;
2015-06-23 15:29:05 -07:00
import gregtech.api.enums.ItemList ;
import gregtech.api.enums.Materials ;
import gregtech.api.enums.OrePrefixes ;
import gregtech.api.interfaces.internal.IGT_RecipeAdder ;
2017-04-22 19:08:47 +02:00
import gregtech.api.objects.GT_FluidStack ;
2015-06-23 15:29:05 -07:00
import gregtech.api.util.GT_ModHandler ;
2017-03-31 22:24:15 +02:00
import gregtech.api.util.GT_OreDictUnificator ;
2015-06-23 15:29:05 -07:00
import gregtech.api.util.GT_Recipe ;
2016-06-30 00:12:00 +02:00
import gregtech.api.util.GT_Recipe.GT_Recipe_AssemblyLine ;
2017-03-31 22:24:15 +02:00
import gregtech.api.util.GT_Utility ;
2017-08-01 18:33:28 +02:00
import gregtech.common.items.GT_IntegratedCircuit_Item ;
2017-06-26 20:25:32 +02:00
import mods.railcraft.common.items.RailcraftToolItems ;
2016-01-03 02:16:02 +01:00
import net.minecraft.init.Blocks ;
2015-06-23 15:29:05 -07:00
import net.minecraft.item.ItemStack ;
import net.minecraftforge.fluids.Fluid ;
import net.minecraftforge.fluids.FluidStack ;
public class GT_RecipeAdder
2015-10-21 22:06:25 -04:00
implements IGT_RecipeAdder {
2017-08-19 10:43:07 +02:00
private boolean isAddingDeprecatedRecipes = false ;
2016-09-15 22:02:18 +02:00
@Deprecated
2015-10-21 22:06:25 -04:00
public boolean addFusionReactorRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , int aDuration , int aEUt , int aStartEU ) {
return false ;
}
@Override
public boolean addFusionReactorRecipe ( FluidStack aInput1 , FluidStack aInput2 , FluidStack aOutput1 , int aDuration , int aEUt , int aStartEU ) {
if ( aInput1 = = null | | aInput2 = = null | | aOutput1 = = null | | aDuration < 1 | | aEUt < 1 | | aStartEU < 1 ) {
return false ;
}
2016-09-15 22:02:18 +02:00
if ( ( aOutput1 ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " fusion " , aOutput1 . getFluid ( ) . getName ( ) , aDuration ) ) < = 0 ) ) {
return false ;
}
2015-10-21 22:06:25 -04:00
GT_Recipe . GT_Recipe_Map . sFusionRecipes . addRecipe ( null , new FluidStack [ ] { aInput1 , aInput2 } , new FluidStack [ ] { aOutput1 } , aDuration , aEUt , aStartEU ) ;
return true ;
}
public boolean addCentrifugeRecipe ( ItemStack aInput1 , int aInput2 , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , ItemStack aOutput4 , ItemStack aOutput5 , ItemStack aOutput6 , int aDuration ) {
return addCentrifugeRecipe ( aInput1 , aInput2 < 0 ? ItemList . IC2_Fuel_Can_Empty . get ( - aInput2 , new Object [ 0 ] ) : aInput2 > 0 ? ItemList . Cell_Empty . get ( aInput2 , new Object [ 0 ] ) : null , null , null , aOutput1 , aOutput2 , aOutput3 , aOutput4 , aOutput5 , aOutput6 , null , aDuration , 5 ) ;
}
public boolean addCentrifugeRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , ItemStack aOutput4 , ItemStack aOutput5 , ItemStack aOutput6 , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( ( aInput1 = = null ) & & ( aFluidInput = = null ) ) | | ( ( aOutput1 = = null ) & & ( aFluidOutput = = null ) ) ) {
return false ;
}
if ( ( aInput1 ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " centrifuge " , aInput1 , aDuration ) ) < = 0 ) ) {
return false ;
}
if ( ( aFluidInput ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " centrifuge " , aFluidInput . getFluid ( ) . getName ( ) , aDuration ) ) < = 0 ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sCentrifugeRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 } , new ItemStack [ ] { aOutput1 , aOutput2 , aOutput3 , aOutput4 , aOutput5 , aOutput6 } , null , aChances , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUt , 0 ) ;
return true ;
}
2016-12-31 10:17:55 +00:00
public boolean addCompressorRecipe ( ItemStack aInput1 , ItemStack aOutput1 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aInput1 ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " compressor " , aInput1 , aDuration ) ) < = 0 ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sCompressorRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 } , new ItemStack [ ] { aOutput1 } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
2015-10-21 22:06:25 -04:00
public boolean addElectrolyzerRecipe ( ItemStack aInput1 , int aInput2 , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , ItemStack aOutput4 , ItemStack aOutput5 , ItemStack aOutput6 , int aDuration , int aEUt ) {
return addElectrolyzerRecipe ( aInput1 , aInput2 < 0 ? ItemList . IC2_Fuel_Can_Empty . get ( - aInput2 , new Object [ 0 ] ) : aInput2 > 0 ? ItemList . Cell_Empty . get ( aInput2 , new Object [ 0 ] ) : null , null , null , aOutput1 , aOutput2 , aOutput3 , aOutput4 , aOutput5 , aOutput6 , null , aDuration , aEUt ) ;
}
public boolean addElectrolyzerRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , ItemStack aOutput4 , ItemStack aOutput5 , ItemStack aOutput6 , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( ( aInput1 = = null ) & & ( aFluidInput = = null ) ) | | ( ( aOutput1 = = null ) & & ( aFluidOutput = = null ) ) ) {
return false ;
}
if ( ( aInput1 ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " electrolyzer " , aInput1 , aDuration ) ) < = 0 ) ) {
return false ;
}
if ( ( aFluidInput ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " electrolyzer " , aFluidInput . getFluid ( ) . getName ( ) , aDuration ) ) < = 0 ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sElectrolyzerRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 } , new ItemStack [ ] { aOutput1 , aOutput2 , aOutput3 , aOutput4 , aOutput5 , aOutput6 } , null , aChances , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addChemicalRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput , int aDuration ) {
return addChemicalRecipe ( aInput1 , aInput2 , null , null , aOutput , aDuration ) ;
}
public boolean addChemicalRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput , int aDuration ) {
return addChemicalRecipe ( aInput1 , aInput2 , aFluidInput , aFluidOutput , aOutput , aDuration , 30 ) ;
}
2017-04-30 01:36:10 +02:00
public boolean addChemicalRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput , ItemStack aOutput2 , int aDuration ) {
return addChemicalRecipe ( aInput1 , aInput2 , aFluidInput , aFluidOutput , aOutput , aOutput2 , aDuration , 30 ) ;
}
public boolean addChemicalRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput , int aDuration , int aEUTick ) {
return addChemicalRecipe ( aInput1 , aInput2 , aFluidInput , aFluidOutput , aOutput , GT_Values . NI , aDuration , aEUTick ) ;
}
2017-06-30 11:32:19 +08:00
2017-07-03 04:29:24 +08:00
public boolean addChemicalRecipeForBasicMachineOnly ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput , ItemStack aOutput2 , int aDuration , int aEUtick ) {
if ( ( ( aInput1 = = null ) & & ( aFluidInput = = null ) ) | | ( ( aOutput = = null ) & & ( aOutput2 = = null ) & & ( aFluidOutput = = null ) ) ) {
return false ;
}
if ( ( aOutput ! = null | | aOutput2 ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " chemicalreactor " , aOutput , aDuration ) ) < = 0 ) ) {
return false ;
}
if ( ( aFluidOutput ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " chemicalreactor " , aFluidOutput . getFluid ( ) . getName ( ) , aDuration ) ) < = 0 ) ) {
return false ;
}
if ( aEUtick < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sChemicalRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 } , new ItemStack [ ] { aOutput , aOutput2 } , null , null , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUtick , 0 ) ;
// GT_Recipe.GT_Recipe_Map.sMultiblockChemicalRecipes.addRecipe(false, new ItemStack[]{aInput1, aInput2}, new ItemStack[]{aOutput, aOutput2}, null, null, new FluidStack[]{aFluidInput}, new FluidStack[]{aFluidOutput}, aDuration, aEUtick, 0);
return true ;
2017-06-30 11:32:19 +08:00
}
2017-04-30 01:36:10 +02:00
2017-07-03 04:29:24 +08:00
public boolean addChemicalRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput , ItemStack aOutput2 , int aDuration , int aEUtick ) {
2017-04-30 01:36:10 +02:00
if ( ( ( aInput1 = = null ) & & ( aFluidInput = = null ) ) | | ( ( aOutput = = null ) & & ( aOutput2 = = null ) & & ( aFluidOutput = = null ) ) ) {
2015-10-21 22:06:25 -04:00
return false ;
}
2017-04-30 01:36:10 +02:00
if ( ( aOutput ! = null | | aOutput2 ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " chemicalreactor " , aOutput , aDuration ) ) < = 0 ) ) {
2015-10-21 22:06:25 -04:00
return false ;
}
if ( ( aFluidOutput ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " chemicalreactor " , aFluidOutput . getFluid ( ) . getName ( ) , aDuration ) ) < = 0 ) ) {
return false ;
}
if ( aEUtick < = 0 ) {
return false ;
}
2017-08-19 10:43:07 +02:00
GT_Recipe . GT_Recipe_Map . sChemicalRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 } , new ItemStack [ ] { aOutput , aOutput2 } , null , null , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUtick , isAddingDeprecatedRecipes ? - 300 : 0 ) ;
2017-08-01 18:33:28 +02:00
if ( ! ( aInput1 ! = null & & aInput1 . getItem ( ) instanceof GT_IntegratedCircuit_Item & & aInput1 . getItemDamage ( ) > = 10 )
& & ! ( aInput2 ! = null & & aInput2 . getItem ( ) instanceof GT_IntegratedCircuit_Item & & aInput2 . getItemDamage ( ) > = 10 ) ) {
2017-08-19 10:43:07 +02:00
GT_Recipe . GT_Recipe_Map . sMultiblockChemicalRecipes . addRecipe ( false , new ItemStack [ ] { aInput1 , aInput2 } , new ItemStack [ ] { aOutput , aOutput2 } , null , null , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUtick , isAddingDeprecatedRecipes ? - 300 : 0 ) ;
2017-08-01 18:33:28 +02:00
}
2015-10-21 22:06:25 -04:00
return true ;
2017-04-22 19:08:47 +02:00
}
2017-05-30 02:10:13 +02:00
public boolean addMultiblockChemicalRecipe ( ItemStack [ ] aInputs , FluidStack [ ] aFluidInputs , FluidStack [ ] aFluidOutputs , ItemStack [ ] aOutputs , int aDuration , int aEUtick ) {
if ( areItemsAndFluidsBothNull ( aInputs , aFluidInputs ) | | areItemsAndFluidsBothNull ( aOutputs , aFluidOutputs ) ) {
return false ;
}
if ( aEUtick < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sMultiblockChemicalRecipes . addRecipe ( false , aInputs , aOutputs , null , null , aFluidInputs , aFluidOutputs , aDuration , aEUtick , 0 ) ;
return true ;
}
2017-04-22 19:08:47 +02:00
@Override
public void addDefaultPolymerizationRecipes ( Fluid aBasicMaterial , Fluid aPolymer ) {
2017-05-30 02:10:13 +02:00
//Oxygen/Titaniumtetrafluoride -> +50% Output each
2017-08-19 13:31:19 +02:00
addChemicalRecipe ( ItemList . Cell_Air . get ( 1 , new Object [ 0 ] ) , GT_Utility . getIntegratedCircuit ( 1 ) , new GT_FluidStack ( aBasicMaterial , 144 ) , new GT_FluidStack ( aPolymer , 144 ) , Materials . Empty . getCells ( 1 ) , 160 ) ;
addChemicalRecipe ( Materials . Oxygen . getCells ( 1 ) , GT_Utility . getIntegratedCircuit ( 1 ) , new GT_FluidStack ( aBasicMaterial , 144 ) , new GT_FluidStack ( aPolymer , 216 ) , Materials . Empty . getCells ( 1 ) , 160 ) ;
2017-05-30 02:10:13 +02:00
addMultiblockChemicalRecipe ( new ItemStack [ ] { GT_Utility . getIntegratedCircuit ( 2 ) } ,
2017-08-19 13:31:19 +02:00
new FluidStack [ ] { new GT_FluidStack ( aBasicMaterial , 2160 ) , Materials . Air . getGas ( 7500 ) , Materials . Titaniumtetrachloride . getFluid ( 100 ) } ,
2017-05-30 02:10:13 +02:00
new FluidStack [ ] { new GT_FluidStack ( aPolymer , 3240 ) } , null , 800 , 30 ) ;
addMultiblockChemicalRecipe ( new ItemStack [ ] { GT_Utility . getIntegratedCircuit ( 2 ) } ,
2017-08-19 13:31:19 +02:00
new FluidStack [ ] { new GT_FluidStack ( aBasicMaterial , 2160 ) , Materials . Oxygen . getGas ( 7500 ) , Materials . Titaniumtetrachloride . getFluid ( 100 ) } ,
2017-05-30 02:10:13 +02:00
new FluidStack [ ] { new GT_FluidStack ( aPolymer , 4320 ) } , null , 800 , 30 ) ;
2015-10-21 22:06:25 -04:00
}
2017-04-22 19:08:47 +02:00
public boolean addBlastRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration , int aEUt , int aLevel ) {
2015-10-21 22:06:25 -04:00
return addBlastRecipe ( aInput1 , aInput2 , null , null , aOutput1 , aOutput2 , aDuration , aEUt , aLevel ) ;
}
public boolean addBlastRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration , int aEUt , int aLevel ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " blastfurnace " , aInput1 , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sBlastRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , null , new FluidStack [ ] { aFluidInput } , null , aDuration , aEUt , aLevel ) ;
return true ;
}
2017-06-10 11:05:27 +02:00
public boolean addPrimitiveBlastRecipe ( ItemStack aInput1 , ItemStack aInput2 , int aCoalAmount , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration ) {
if ( ( aInput1 = = null & & aInput2 = = null ) | | ( aOutput1 = = null & & aOutput2 = = null ) ) {
return false ;
}
if ( aCoalAmount < = 0 ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " primitiveblastfurnace " , aInput1 , aDuration ) ) < = 0 ) {
return false ;
}
2017-06-23 23:48:38 +02:00
for ( Materials coal : new Materials [ ] { Materials . Coal , Materials . Charcoal } ) {
GT_Recipe . GT_Recipe_Map . sPrimitiveBlastRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 , coal . getGems ( aCoalAmount ) } , new ItemStack [ ] { aOutput1 , aOutput2 , Materials . DarkAsh . getDustTiny ( aCoalAmount ) } , null , null , null , null , aDuration , 0 , 0 ) ;
GT_Recipe . GT_Recipe_Map . sPrimitiveBlastRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 , coal . getDust ( aCoalAmount ) } , new ItemStack [ ] { aOutput1 , aOutput2 , Materials . DarkAsh . getDustTiny ( aCoalAmount ) } , null , null , null , null , aDuration , 0 , 0 ) ;
}
2017-06-10 11:05:27 +02:00
if ( Loader . isModLoaded ( " Railcraft " ) ) {
GT_Recipe . GT_Recipe_Map . sPrimitiveBlastRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 , RailcraftToolItems . getCoalCoke ( aCoalAmount / 2 ) } , new ItemStack [ ] { aOutput1 , aOutput2 , Materials . Ash . getDustTiny ( aCoalAmount / 2 ) } , null , null , null , null , aDuration * 2 / 3 , 0 , 0 ) ;
}
return true ;
}
2015-10-21 22:06:25 -04:00
public boolean addCannerRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " canning " , aInput1 , aDuration ) ) < = 0 ) {
return false ;
}
new GT_Recipe ( aInput1 , aEUt , aInput2 , aDuration , aOutput1 , aOutput2 ) ;
return true ;
}
2016-03-20 16:47:17 +01:00
@Override
public boolean addAlloySmelterRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , int aDuration , int aEUt ) {
return addAlloySmelterRecipe ( aInput1 , aInput2 , aOutput1 , aDuration , aEUt , false ) ;
}
2015-10-21 22:06:25 -04:00
2016-03-20 16:47:17 +01:00
public boolean addAlloySmelterRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , int aDuration , int aEUt , boolean hidden ) {
2015-10-21 22:06:25 -04:00
if ( ( aInput1 = = null ) | | ( aOutput1 = = null | | Materials . Graphite . contains ( aInput1 ) ) ) {
return false ;
}
if ( ( aInput2 = = null ) & & ( ( OrePrefixes . ingot . contains ( aInput1 ) ) | | ( OrePrefixes . dust . contains ( aInput1 ) ) | | ( OrePrefixes . gem . contains ( aInput1 ) ) ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " alloysmelting " , aInput2 = = null ? aInput1 : aOutput1 , aDuration ) ) < = 0 ) {
return false ;
}
2016-03-20 16:47:17 +01:00
GT_Recipe tRecipe = new GT_Recipe ( aInput1 , aInput2 , aEUt , aDuration , aOutput1 ) ;
if ( ( hidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
2015-10-21 22:06:25 -04:00
return true ;
}
public boolean addCNCRecipe ( ItemStack aInput1 , ItemStack aOutput1 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
2016-08-14 07:34:36 +01:00
if ( ( GregTech_API . sRecipeFile . get ( " cnc " , aOutput1 , aDuration ) ) < = 0 ) {
2015-10-21 22:06:25 -04:00
return false ;
}
return true ;
}
public boolean addLatheRecipe ( ItemStack aInput1 , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " lathe " , aInput1 , aDuration ) ) < = 0 ) {
return false ;
}
new GT_Recipe ( aInput1 , aOutput1 , aOutput2 , aDuration , aEUt ) ;
return true ;
}
public boolean addCutterRecipe ( ItemStack aInput , FluidStack aLubricant , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aLubricant = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " cutting " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sCutterRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , new FluidStack [ ] { aLubricant } , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addCutterRecipe ( ItemStack aInput , ItemStack aOutput1 , ItemStack aOutput2 , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " cutting " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sCutterRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , new FluidStack [ ] { Materials . Water . getFluid ( Math . max ( 4 , Math . min ( 1000 , aDuration * aEUt / 320 ) ) ) } , null , aDuration * 2 , aEUt , 0 ) ;
GT_Recipe . GT_Recipe_Map . sCutterRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , new FluidStack [ ] { GT_ModHandler . getDistilledWater ( Math . max ( 3 , Math . min ( 750 , aDuration * aEUt / 426 ) ) ) } , null , aDuration * 2 , aEUt , 0 ) ;
GT_Recipe . GT_Recipe_Map . sCutterRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , new FluidStack [ ] { Materials . Lubricant . getFluid ( Math . max ( 1 , Math . min ( 250 , aDuration * aEUt / 1280 ) ) ) } , null , aDuration , aEUt , 0 ) ;
return true ;
}
2017-03-31 22:24:15 +02:00
2017-07-31 09:24:13 +02:00
public boolean addAssemblerRecipe ( ItemStack aInput1 , Object aOreDict , int aAmount , FluidStack aFluidInput , ItemStack aOutput1 , int aDuration , int aEUt ) {
2017-03-31 22:24:15 +02:00
for ( ItemStack tStack : GT_OreDictUnificator . getOres ( aOreDict ) ) {
2017-03-31 22:37:51 +02:00
if ( GT_Utility . isStackValid ( tStack ) )
2017-03-31 22:24:15 +02:00
addAssemblerRecipe ( aInput1 , GT_Utility . copyAmount ( aAmount , tStack ) , aFluidInput , aOutput1 , aDuration , aEUt ) ;
}
return true ;
}
2015-10-21 22:06:25 -04:00
2017-07-31 09:24:13 +02:00
public boolean addAssemblerRecipe ( ItemStack [ ] aInputs , Object aOreDict , int aAmount , FluidStack aFluidInput , ItemStack aOutput1 , int aDuration , int aEUt ) {
for ( ItemStack tStack : GT_OreDictUnificator . getOres ( aOreDict ) ) {
if ( GT_Utility . isStackValid ( tStack ) ) {
ItemStack [ ] extendedInputs = new ItemStack [ aInputs . length + 1 ] ;
System . arraycopy ( aInputs , 0 , extendedInputs , 0 , aInputs . length ) ;
extendedInputs [ aInputs . length ] = GT_Utility . copyAmount ( aAmount , tStack ) ;
addAssemblerRecipe ( extendedInputs , aFluidInput , aOutput1 , aDuration , aEUt ) ;
}
}
return true ;
}
2015-10-21 22:06:25 -04:00
public boolean addAssemblerRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " assembling " , aOutput1 , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sAssemblerRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 = = null ? aInput1 : aInput2 } , new ItemStack [ ] { aOutput1 } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addAssemblerRecipe ( ItemStack aInput1 , ItemStack aInput2 , FluidStack aFluidInput , ItemStack aOutput1 , int aDuration , int aEUt ) {
2017-06-03 12:45:20 +02:00
return addAssemblerRecipe ( new ItemStack [ ] { aInput1 , aInput2 } , aFluidInput , aOutput1 , aDuration , aEUt ) ;
}
public boolean addAssemblerRecipe ( ItemStack [ ] aInputs , FluidStack aFluidInput , ItemStack aOutput1 , int aDuration , int aEUt ) {
2017-06-14 22:24:31 +02:00
if ( areItemsAndFluidsBothNull ( aInputs , new FluidStack [ ] { aFluidInput } ) ) {
return false ;
}
if ( aOutput1 = = null ) {
2017-06-03 12:45:20 +02:00
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " assembling " , aOutput1 , aDuration ) ) < = 0 ) {
2015-10-21 22:06:25 -04:00
return false ;
}
2017-06-03 12:45:20 +02:00
GT_Recipe . GT_Recipe_Map . sAssemblerRecipes . addRecipe ( true , aInputs , new ItemStack [ ] { aOutput1 } , null , new FluidStack [ ] { aFluidInput } , null , aDuration , aEUt , 0 ) ;
2015-10-21 22:06:25 -04:00
return true ;
}
public boolean addWiremillRecipe ( ItemStack aInput , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " wiremill " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sWiremillRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addPolarizerRecipe ( ItemStack aInput , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " polarizer " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sPolarizerRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addBenderRecipe ( ItemStack aInput1 , ItemStack aOutput1 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " bender " , aInput1 , aDuration ) ) < = 0 ) {
return false ;
}
new GT_Recipe ( aEUt , aDuration , aInput1 , aOutput1 ) ;
return true ;
}
public boolean addExtruderRecipe ( ItemStack aInput , ItemStack aShape , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aShape = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " extruder " , aOutput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sExtruderRecipes . addRecipe ( true , new ItemStack [ ] { aInput , aShape } , new ItemStack [ ] { aOutput } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addSlicerRecipe ( ItemStack aInput , ItemStack aShape , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aShape = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " slicer " , aOutput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sSlicerRecipes . addRecipe ( true , new ItemStack [ ] { aInput , aShape } , new ItemStack [ ] { aOutput } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
2016-12-31 10:17:55 +00:00
public boolean addOreWasherRecipe ( ItemStack aInput , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , FluidStack aFluidInput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aFluidInput = = null ) | | ( ( aOutput1 = = null ) | | ( aOutput2 = = null ) | | ( aOutput3 = = null ) ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " orewasher " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sOreWasherRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 , aOutput3 } , null , new FluidStack [ ] { aFluidInput } , null , aDuration , aEUt , 0 ) ;
return true ;
}
2015-10-21 22:06:25 -04:00
public boolean addImplosionRecipe ( ItemStack aInput1 , int aInput2 , ItemStack aOutput1 , ItemStack aOutput2 ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aInput2 = GregTech_API . sRecipeFile . get ( " implosion " , aInput1 , aInput2 ) ) < = 0 ) {
return false ;
}
2016-01-03 02:16:02 +01:00
int tExplosives = aInput2 > 0 ? aInput2 < 64 ? aInput2 : 64 : 1 ;
int tGunpowder = tExplosives * 2 ;
2017-06-17 12:04:33 +02:00
int tDynamite = Math . max ( 1 , tExplosives / 2 ) ;
2016-01-03 02:16:02 +01:00
int tTNT = Math . max ( 1 , tExplosives / 2 ) ;
int tITNT = Math . max ( 1 , tExplosives / 4 ) ;
//new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2);
if ( tGunpowder < 65 ) {
GT_Recipe . GT_Recipe_Map . sImplosionRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , ItemList . Block_Powderbarrel . get ( tGunpowder , new Object [ 0 ] ) } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , null , null , null , 20 , 30 , 0 ) ;
}
2016-03-18 22:43:22 +01:00
if ( tDynamite < 17 ) {
2016-01-03 02:16:02 +01:00
GT_Recipe . GT_Recipe_Map . sImplosionRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , GT_ModHandler . getIC2Item ( " dynamite " , tDynamite , null ) } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , null , null , null , 20 , 30 , 0 ) ;
}
GT_Recipe . GT_Recipe_Map . sImplosionRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , new ItemStack ( Blocks . tnt , tTNT ) } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , null , null , null , 20 , 30 , 0 ) ;
GT_Recipe . GT_Recipe_Map . sImplosionRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , GT_ModHandler . getIC2Item ( " industrialTnt " , tITNT , null ) } , new ItemStack [ ] { aOutput1 , aOutput2 } , null , null , null , null , 20 , 30 , 0 ) ;
2015-10-21 22:06:25 -04:00
return true ;
}
@Deprecated
public boolean addDistillationRecipe ( ItemStack aInput1 , int aInput2 , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , ItemStack aOutput4 , int aDuration , int aEUt ) {
2015-06-23 15:29:05 -07:00
// if ((aInput1 == null) || (aOutput1 == null)) {
// return false;
// }
// if ((aDuration = GregTech_API.sRecipeFile.get("distillation", aInput1, aDuration)) <= 0) {
// return false;
// }
// new GT_Recipe(aInput1, aInput2, aOutput1, aOutput2, aOutput3, aOutput4, aDuration, aEUt);
// return true;
2015-10-21 22:06:25 -04:00
return false ;
}
@Override
public boolean addUniversalDistillationRecipe ( FluidStack aInput , FluidStack [ ] aOutputs , ItemStack aOutput2 , int aDuration , int aEUt ) {
2017-05-24 23:59:42 +02:00
for ( int i = 0 ; i < Math . min ( aOutputs . length , 11 ) ; i + + ) {
2017-06-01 22:59:06 +02:00
addDistilleryRecipe ( i + 1 , aInput , aOutputs [ i ] , aOutput2 , aDuration * 2 , aEUt / 4 , false ) ;
2017-05-24 23:59:42 +02:00
}
2015-10-21 22:06:25 -04:00
return addDistillationTowerRecipe ( aInput , aOutputs , aOutput2 , aDuration , aEUt ) ;
}
public boolean addDistillationTowerRecipe ( FluidStack aInput , FluidStack [ ] aOutputs , ItemStack aOutput2 , int aDuration , int aEUt ) {
2017-05-24 23:59:42 +02:00
if ( aInput = = null | | aOutputs = = null | | aOutputs . length < 1 | | aOutputs . length > 11 ) {
2015-10-21 22:06:25 -04:00
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " distillation " , aInput . getUnlocalizedName ( ) , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sDistillationRecipes . addRecipe ( false , null , new ItemStack [ ] { aOutput2 } , null , new FluidStack [ ] { aInput } , aOutputs , Math . max ( 1 , aDuration ) , Math . max ( 1 , aEUt ) , 0 ) ;
2015-10-21 20:47:13 -04:00
return false ;
2015-10-21 22:06:25 -04:00
}
public boolean addVacuumFreezerRecipe ( ItemStack aInput1 , ItemStack aOutput1 , int aDuration ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " vacuumfreezer " , aInput1 , aDuration ) ) < = 0 ) {
return false ;
}
new GT_Recipe ( aInput1 , aOutput1 , aDuration ) ;
return true ;
}
public boolean addGrinderRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , ItemStack aOutput4 ) {
return false ;
}
public boolean addFuel ( ItemStack aInput1 , ItemStack aOutput1 , int aEU , int aType ) {
if ( aInput1 = = null ) {
return false ;
}
new GT_Recipe ( aInput1 , aOutput1 , GregTech_API . sRecipeFile . get ( " fuel_ " + aType , aInput1 , aEU ) , aType ) ;
return true ;
}
public boolean addSonictronSound ( ItemStack aItemStack , String aSoundName ) {
if ( ( aItemStack = = null ) | | ( aSoundName = = null ) | | ( aSoundName . equals ( " " ) ) ) {
2015-10-21 20:47:13 -04:00
return false ;
2015-08-02 13:00:23 +02:00
}
2015-10-21 22:06:25 -04:00
GT_Mod . gregtechproxy . mSoundItems . add ( aItemStack ) ;
GT_Mod . gregtechproxy . mSoundNames . add ( aSoundName ) ;
if ( aSoundName . startsWith ( " note. " ) ) {
GT_Mod . gregtechproxy . mSoundCounts . add ( Integer . valueOf ( 25 ) ) ;
} else {
GT_Mod . gregtechproxy . mSoundCounts . add ( Integer . valueOf ( 1 ) ) ;
}
return true ;
}
public boolean addForgeHammerRecipe ( ItemStack aInput1 , ItemStack aOutput1 , int aDuration , int aEUt ) {
if ( ( aInput1 = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ! GregTech_API . sRecipeFile . get ( " forgehammer " , aOutput1 , true ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sHammerRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 } , new ItemStack [ ] { aOutput1 } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addBoxingRecipe ( ItemStack aContainedItem , ItemStack aEmptyBox , ItemStack aFullBox , int aDuration , int aEUt ) {
if ( ( aContainedItem = = null ) | | ( aFullBox = = null ) ) {
return false ;
}
if ( ! GregTech_API . sRecipeFile . get ( " boxing " , aFullBox , true ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sBoxinatorRecipes . addRecipe ( true , new ItemStack [ ] { aContainedItem , aEmptyBox } , new ItemStack [ ] { aFullBox } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addUnboxingRecipe ( ItemStack aFullBox , ItemStack aContainedItem , ItemStack aEmptyBox , int aDuration , int aEUt ) {
if ( ( aFullBox = = null ) | | ( aContainedItem = = null ) ) {
return false ;
}
if ( ! GregTech_API . sRecipeFile . get ( " unboxing " , aFullBox , true ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sUnboxinatorRecipes . addRecipe ( true , new ItemStack [ ] { aFullBox } , new ItemStack [ ] { aContainedItem , aEmptyBox } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
2016-12-31 10:17:55 +00:00
public boolean addThermalCentrifugeRecipe ( ItemStack aInput , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ! GregTech_API . sRecipeFile . get ( " thermalcentrifuge " , aInput , true ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sThermalCentrifugeRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 , aOutput3 } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
2015-10-21 22:06:25 -04:00
public boolean addAmplifier ( ItemStack aAmplifierItem , int aDuration , int aAmplifierAmountOutputted ) {
if ( ( aAmplifierItem = = null ) | | ( aAmplifierAmountOutputted < = 0 ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " amplifier " , aAmplifierItem , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sAmplifiers . addRecipe ( true , new ItemStack [ ] { aAmplifierItem } , null , null , null , new FluidStack [ ] { Materials . UUAmplifier . getFluid ( aAmplifierAmountOutputted ) } , aDuration , 32 , 0 ) ;
return true ;
}
public boolean addBrewingRecipe ( ItemStack aIngredient , Fluid aInput , Fluid aOutput , boolean aHidden ) {
if ( ( aIngredient = = null ) | | ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ! GregTech_API . sRecipeFile . get ( " brewing " , aOutput . getUnlocalizedName ( ) , true ) ) {
return false ;
}
GT_Recipe tRecipe = GT_Recipe . GT_Recipe_Map . sBrewingRecipes . addRecipe ( false , new ItemStack [ ] { aIngredient } , null , null , new FluidStack [ ] { new FluidStack ( aInput , 750 ) } , new FluidStack [ ] { new FluidStack ( aOutput , 750 ) } , 128 , 4 , 0 ) ;
if ( ( aHidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
return true ;
}
public boolean addFermentingRecipe ( FluidStack aInput , FluidStack aOutput , int aDuration , boolean aHidden ) {
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " fermenting " , aOutput . getFluid ( ) . getUnlocalizedName ( ) , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe tRecipe = GT_Recipe . GT_Recipe_Map . sFermentingRecipes . addRecipe ( false , null , null , null , new FluidStack [ ] { aInput } , new FluidStack [ ] { aOutput } , aDuration , 2 , 0 ) ;
if ( ( aHidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
return true ;
}
2017-06-01 22:59:06 +02:00
public boolean addDistilleryRecipe ( ItemStack aCircuit , FluidStack aInput , FluidStack aOutput , ItemStack aSolidOutput , int aDuration , int aEUt , boolean aHidden ) {
2015-10-21 22:06:25 -04:00
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " distillery " , aOutput . getFluid ( ) . getUnlocalizedName ( ) , aDuration ) ) < = 0 ) {
return false ;
}
2017-06-01 22:59:06 +02:00
GT_Recipe tRecipe = GT_Recipe . GT_Recipe_Map . sDistilleryRecipes . addRecipe ( true , new ItemStack [ ] { aCircuit } , new ItemStack [ ] { aSolidOutput } , null , new FluidStack [ ] { aInput } , new FluidStack [ ] { aOutput } , aDuration , aEUt , 0 ) ;
2015-10-21 22:06:25 -04:00
if ( ( aHidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
return true ;
}
2017-06-01 22:59:06 +02:00
public boolean addDistilleryRecipe ( ItemStack aCircuit , FluidStack aInput , FluidStack aOutput , int aDuration , int aEUt , boolean aHidden ) {
return addDistilleryRecipe ( aCircuit , aInput , aOutput , null , aDuration , aEUt , aHidden ) ;
}
public boolean addDistilleryRecipe ( int circuitConfig , FluidStack aInput , FluidStack aOutput , ItemStack aSolidOutput , int aDuration , int aEUt , boolean aHidden ) {
return addDistilleryRecipe ( GT_Utility . getIntegratedCircuit ( circuitConfig ) , aInput , aOutput , aSolidOutput , aDuration , aEUt , aHidden ) ;
}
Added a lot of (petro)chemistry stuff, expanded the API
Created an adapter class for creating materials.
Materials now have bit flags for automatic gas/fluid creation.
Added a new convenience method for adding distillery recipes.
Recipes now show the exact recipe duration instead of the duration
rounded down to the nearest int.
Added new Materials with relevant recipes:
Acetic Acid, Acetone, Calcium Acetate, Charcoal Byproducts, Carbon
Monoxide, Ethanol, Ethylene, Methanol, Methyl Acetate, Polyvinyl
Acetate, Propene, Sulfuric Ethylene, Vinyl Acetate
Made vinegar visible.
2017-04-19 23:36:50 +02:00
public boolean addDistilleryRecipe ( int circuitConfig , FluidStack aInput , FluidStack aOutput , int aDuration , int aEUt , boolean aHidden ) {
2017-06-01 22:59:06 +02:00
return addDistilleryRecipe ( GT_Utility . getIntegratedCircuit ( circuitConfig ) , aInput , aOutput , aDuration , aEUt , aHidden ) ;
Added a lot of (petro)chemistry stuff, expanded the API
Created an adapter class for creating materials.
Materials now have bit flags for automatic gas/fluid creation.
Added a new convenience method for adding distillery recipes.
Recipes now show the exact recipe duration instead of the duration
rounded down to the nearest int.
Added new Materials with relevant recipes:
Acetic Acid, Acetone, Calcium Acetate, Charcoal Byproducts, Carbon
Monoxide, Ethanol, Ethylene, Methanol, Methyl Acetate, Polyvinyl
Acetate, Propene, Sulfuric Ethylene, Vinyl Acetate
Made vinegar visible.
2017-04-19 23:36:50 +02:00
}
2015-10-21 22:06:25 -04:00
public boolean addFluidSolidifierRecipe ( ItemStack aMold , FluidStack aInput , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aMold = = null ) | | ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( aInput . isFluidEqual ( Materials . PhasedGold . getMolten ( 144 ) ) ) {
aInput = Materials . VibrantAlloy . getMolten ( aInput . amount ) ;
}
if ( aInput . isFluidEqual ( Materials . PhasedIron . getMolten ( 144 ) ) ) {
aInput = Materials . PulsatingIron . getMolten ( aInput . amount ) ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " fluidsolidifier " , aOutput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sFluidSolidficationRecipes . addRecipe ( true , new ItemStack [ ] { aMold } , new ItemStack [ ] { aOutput } , null , new FluidStack [ ] { aInput } , null , aDuration , aEUt , 0 ) ;
return true ;
}
2016-03-20 16:47:17 +01:00
@Override
public boolean addFluidSmelterRecipe ( ItemStack aInput , ItemStack aRemains , FluidStack aOutput , int aChance , int aDuration , int aEUt ) {
return addFluidSmelterRecipe ( aInput , aRemains , aOutput , aChance , aDuration , aEUt , false ) ;
}
2015-10-21 22:06:25 -04:00
2016-03-20 16:47:17 +01:00
public boolean addFluidSmelterRecipe ( ItemStack aInput , ItemStack aRemains , FluidStack aOutput , int aChance , int aDuration , int aEUt , boolean hidden ) {
2015-10-21 22:06:25 -04:00
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( aOutput . isFluidEqual ( Materials . PhasedGold . getMolten ( 1 ) ) ) {
aOutput = Materials . VibrantAlloy . getMolten ( aOutput . amount ) ;
}
if ( aOutput . isFluidEqual ( Materials . PhasedIron . getMolten ( 1 ) ) ) {
aOutput = Materials . PulsatingIron . getMolten ( aOutput . amount ) ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " fluidsmelter " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
2016-03-20 16:47:17 +01:00
GT_Recipe tRecipe = GT_Recipe . GT_Recipe_Map . sFluidExtractionRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aRemains } , null , new int [ ] { aChance } , null , new FluidStack [ ] { aOutput } , aDuration , aEUt , 0 ) ;
if ( ( hidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
2015-10-21 22:06:25 -04:00
return true ;
}
public boolean addFluidExtractionRecipe ( ItemStack aInput , ItemStack aRemains , FluidStack aOutput , int aChance , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( aOutput . isFluidEqual ( Materials . PhasedGold . getMolten ( 1 ) ) ) {
aOutput = Materials . VibrantAlloy . getMolten ( aOutput . amount ) ;
}
if ( aOutput . isFluidEqual ( Materials . PhasedIron . getMolten ( 1 ) ) ) {
aOutput = Materials . PulsatingIron . getMolten ( aOutput . amount ) ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " fluidextractor " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sFluidExtractionRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aRemains } , null , new int [ ] { aChance } , null , new FluidStack [ ] { aOutput } , aDuration , aEUt , 0 ) ;
return true ;
}
public boolean addFluidCannerRecipe ( ItemStack aInput , ItemStack aOutput , FluidStack aFluidInput , FluidStack aFluidOutput ) {
if ( ( aInput ! = null ) & & ( aOutput ! = null ) ) {
if ( ( aFluidInput = = null ? 1 : 0 ) ! = ( aFluidOutput = = null ? 1 : 0 ) ) {
}
} else {
return false ;
}
if ( ! GregTech_API . sRecipeFile . get ( " fluidcanner " , aOutput , true ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sFluidCannerRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput } , null , new FluidStack [ ] { aFluidInput = = null ? null : aFluidInput } , new FluidStack [ ] { aFluidOutput = = null ? null : aFluidOutput } , aFluidOutput = = null ? aFluidInput . amount / 62 : aFluidOutput . amount / 62 , 1 , 0 ) ;
return true ;
}
public boolean addChemicalBathRecipe ( ItemStack aInput , FluidStack aBathingFluid , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aBathingFluid = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " chemicalbath " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sChemicalBathRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 , aOutput3 } , null , aChances , new FluidStack [ ] { aBathingFluid } , null , aDuration , aEUt , 0 ) ;
return true ;
2015-08-02 13:00:23 +02:00
}
2015-06-23 15:29:05 -07:00
2015-10-21 22:06:25 -04:00
public boolean addElectromagneticSeparatorRecipe ( ItemStack aInput , ItemStack aOutput1 , ItemStack aOutput2 , ItemStack aOutput3 , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput1 = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " electromagneticseparator " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sElectroMagneticSeparatorRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput1 , aOutput2 , aOutput3 } , null , aChances , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
2016-12-31 10:17:55 +00:00
public boolean addExtractorRecipe ( ItemStack aInput , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " extractor " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sExtractorRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
2015-10-21 22:06:25 -04:00
public boolean addPrinterRecipe ( ItemStack aInput , FluidStack aFluid , ItemStack aSpecialSlot , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aFluid = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " printer " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sPrinterRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput } , aSpecialSlot , null , new FluidStack [ ] { aFluid } , null , aDuration , aEUt , 0 ) ;
return true ;
}
2017-04-24 23:07:26 +02:00
2015-10-21 22:06:25 -04:00
public boolean addAutoclaveRecipe ( ItemStack aInput , FluidStack aFluid , ItemStack aOutput , int aChance , int aDuration , int aEUt ) {
2017-02-28 02:04:47 +01:00
return addAutoclaveRecipe ( aInput , aFluid , aOutput , aChance , aDuration , aEUt , false ) ;
}
public boolean addAutoclaveRecipe ( ItemStack aInput , FluidStack aFluid , ItemStack aOutput , int aChance , int aDuration , int aEUt , boolean aCleanroom ) {
2015-10-21 22:06:25 -04:00
if ( ( aInput = = null ) | | ( aFluid = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " autoclave " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
2017-06-14 18:55:26 +10:00
if ( ! GT_Mod . gregtechproxy . mEnableCleanroom ) {
aCleanroom = false ;
}
2017-02-28 02:04:47 +01:00
GT_Recipe . GT_Recipe_Map . sAutoclaveRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , new ItemStack [ ] { aOutput } , null , new int [ ] { aChance } , new FluidStack [ ] { aFluid } , null , aDuration , aEUt , aCleanroom ? - 100 : 0 ) ;
2015-10-21 22:06:25 -04:00
return true ;
}
public boolean addMixerRecipe ( ItemStack aInput1 , ItemStack aInput2 , ItemStack aInput3 , ItemStack aInput4 , FluidStack aFluidInput , FluidStack aFluidOutput , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( ( aInput1 = = null ) & & ( aFluidInput = = null ) ) | | ( ( aOutput = = null ) & & ( aFluidOutput = = null ) ) ) {
return false ;
}
if ( ( aOutput ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " mixer " , aOutput , aDuration ) ) < = 0 ) ) {
return false ;
}
if ( ( aFluidOutput ! = null ) & & ( ( aDuration = GregTech_API . sRecipeFile . get ( " mixer " , aFluidOutput . getFluid ( ) . getName ( ) , aDuration ) ) < = 0 ) ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sMixerRecipes . addRecipe ( true , new ItemStack [ ] { aInput1 , aInput2 , aInput3 , aInput4 } , new ItemStack [ ] { aOutput } , null , null , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUt , 0 ) ;
return true ;
}
2017-04-24 23:07:26 +02:00
2015-10-21 22:06:25 -04:00
public boolean addLaserEngraverRecipe ( ItemStack aItemToEngrave , ItemStack aLens , ItemStack aEngravedItem , int aDuration , int aEUt ) {
2017-02-28 02:04:47 +01:00
return addLaserEngraverRecipe ( aItemToEngrave , aLens , aEngravedItem , aDuration , aEUt , false ) ;
}
public boolean addLaserEngraverRecipe ( ItemStack aItemToEngrave , ItemStack aLens , ItemStack aEngravedItem , int aDuration , int aEUt , boolean aCleanroom ) {
2015-10-21 22:06:25 -04:00
if ( ( aItemToEngrave = = null ) | | ( aLens = = null ) | | ( aEngravedItem = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " laserengraving " , aEngravedItem , aDuration ) ) < = 0 ) {
return false ;
}
2017-06-14 18:55:26 +10:00
if ( ! GT_Mod . gregtechproxy . mEnableCleanroom ) {
aCleanroom = false ;
}
2017-02-28 02:04:47 +01:00
GT_Recipe . GT_Recipe_Map . sLaserEngraverRecipes . addRecipe ( true , new ItemStack [ ] { aItemToEngrave , aLens } , new ItemStack [ ] { aEngravedItem } , null , null , null , aDuration , aEUt , aCleanroom ? - 200 : 0 ) ;
2015-10-21 22:06:25 -04:00
return true ;
}
public boolean addFormingPressRecipe ( ItemStack aItemToImprint , ItemStack aForm , ItemStack aImprintedItem , int aDuration , int aEUt ) {
if ( ( aItemToImprint = = null ) | | ( aForm = = null ) | | ( aImprintedItem = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " press " , aImprintedItem , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sPressRecipes . addRecipe ( true , new ItemStack [ ] { aItemToImprint , aForm } , new ItemStack [ ] { aImprintedItem } , null , null , null , aDuration , aEUt , 0 ) ;
return true ;
2015-06-23 15:29:05 -07:00
}
2015-10-21 22:06:25 -04:00
public boolean addFluidHeaterRecipe ( ItemStack aCircuit , FluidStack aInput , FluidStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutput = = null ) ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " fluidheater " , aOutput . getFluid ( ) . getUnlocalizedName ( ) , aDuration ) ) < = 0 ) {
return false ;
2015-06-23 15:29:05 -07:00
}
2015-10-21 22:06:25 -04:00
GT_Recipe . GT_Recipe_Map . sFluidHeaterRecipes . addRecipe ( true , new ItemStack [ ] { aCircuit } , null , null , new FluidStack [ ] { aInput } , new FluidStack [ ] { aOutput } , aDuration , aEUt , 0 ) ;
2015-06-23 15:29:05 -07:00
return true ;
}
2015-04-26 02:04:07 +02:00
2015-10-21 22:06:25 -04:00
public boolean addSifterRecipe ( ItemStack aItemToSift , ItemStack [ ] aSiftedItems , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( aItemToSift = = null ) | | ( aSiftedItems = = null ) ) {
return false ;
}
for ( ItemStack tStack : aSiftedItems ) {
if ( tStack ! = null ) {
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " sifter " , aItemToSift , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sSifterRecipes . addRecipe ( true , new ItemStack [ ] { aItemToSift } , aSiftedItems , null , aChances , null , null , aDuration , aEUt , 0 ) ;
return true ;
}
}
2015-10-21 20:47:13 -04:00
return false ;
2015-10-21 22:06:25 -04:00
}
2016-03-20 16:47:17 +01:00
@Override
public boolean addArcFurnaceRecipe ( ItemStack aInput , ItemStack [ ] aOutputs , int [ ] aChances , int aDuration , int aEUt ) {
return addArcFurnaceRecipe ( aInput , aOutputs , aChances , aDuration , aEUt , false ) ;
}
2015-10-21 20:47:13 -04:00
2016-03-20 16:47:17 +01:00
public boolean addArcFurnaceRecipe ( ItemStack aInput , ItemStack [ ] aOutputs , int [ ] aChances , int aDuration , int aEUt , boolean hidden ) {
2015-10-21 22:06:25 -04:00
if ( ( aInput = = null ) | | ( aOutputs = = null ) ) {
return false ;
}
for ( ItemStack tStack : aOutputs ) {
if ( tStack ! = null ) {
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " arcfurnace " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
2016-03-20 16:47:17 +01:00
GT_Recipe sRecipe = GT_Recipe . GT_Recipe_Map . sArcFurnaceRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , aOutputs , null , aChances , new FluidStack [ ] { Materials . Oxygen . getGas ( aDuration ) } , null , Math . max ( 1 , aDuration ) , Math . max ( 1 , aEUt ) , 0 ) ;
if ( ( hidden ) & & ( sRecipe ! = null ) ) {
sRecipe . mHidden = true ;
}
2015-10-21 22:06:25 -04:00
for ( Materials tMaterial : new Materials [ ] { Materials . Argon , Materials . Nitrogen } ) {
if ( tMaterial . mPlasma ! = null ) {
int tPlasmaAmount = ( int ) Math . max ( 1L , aDuration / ( tMaterial . getMass ( ) * 16L ) ) ;
2016-03-20 16:47:17 +01:00
GT_Recipe tRecipe = GT_Recipe . GT_Recipe_Map . sPlasmaArcFurnaceRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , aOutputs , null , aChances , new FluidStack [ ] { tMaterial . getPlasma ( tPlasmaAmount ) } , new FluidStack [ ] { tMaterial . getGas ( tPlasmaAmount ) } , Math . max ( 1 , aDuration / 16 ) , Math . max ( 1 , aEUt / 3 ) , 0 ) ;
if ( ( hidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
2015-10-21 22:06:25 -04:00
}
}
return true ;
}
}
2015-10-21 20:47:13 -04:00
return false ;
2015-10-21 22:06:25 -04:00
}
public boolean addSimpleArcFurnaceRecipe ( ItemStack aInput , FluidStack aFluidInput , ItemStack [ ] aOutputs , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutputs = = null ) | | aFluidInput = = null ) {
return false ;
}
for ( ItemStack tStack : aOutputs ) {
if ( tStack ! = null ) {
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " arcfurnace " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sArcFurnaceRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , aOutputs , null , aChances , new FluidStack [ ] { aFluidInput } , null , Math . max ( 1 , aDuration ) , Math . max ( 1 , aEUt ) , 0 ) ;
return true ;
}
}
return false ;
}
public boolean addPlasmaArcFurnaceRecipe ( ItemStack aInput , FluidStack aFluidInput , ItemStack [ ] aOutputs , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutputs = = null ) | | aFluidInput = = null ) {
return false ;
}
for ( ItemStack tStack : aOutputs ) {
if ( tStack ! = null ) {
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " arcfurnace " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sPlasmaArcFurnaceRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , aOutputs , null , aChances , new FluidStack [ ] { aFluidInput } , null , Math . max ( 1 , aDuration ) , Math . max ( 1 , aEUt ) , 0 ) ;
return true ;
}
}
return false ;
}
2015-10-21 20:47:13 -04:00
2015-10-21 22:06:25 -04:00
public boolean addPlasmaArcFurnaceRecipe ( ItemStack aInput , FluidStack aFluidInput , ItemStack [ ] aOutputs , FluidStack aFluidOutput , int [ ] aChances , int aDuration , int aEUt ) {
if ( ( aInput = = null ) | | ( aOutputs = = null ) | | aFluidInput = = null ) {
return false ;
}
for ( ItemStack tStack : aOutputs ) {
if ( tStack ! = null ) {
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " arcfurnace " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sPlasmaArcFurnaceRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , aOutputs , null , aChances , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , Math . max ( 1 , aDuration ) , Math . max ( 1 , aEUt ) , 0 ) ;
return true ;
}
}
return false ;
}
2016-03-20 16:47:17 +01:00
@Override
public boolean addPulveriserRecipe ( ItemStack aInput , ItemStack [ ] aOutputs , int [ ] aChances , int aDuration , int aEUt ) {
return addPulveriserRecipe ( aInput , aOutputs , aChances , aDuration , aEUt , false ) ;
}
public boolean addPulveriserRecipe ( ItemStack aInput , ItemStack [ ] aOutputs , int [ ] aChances , int aDuration , int aEUt , boolean hidden ) {
2015-10-21 22:06:25 -04:00
if ( ( aInput = = null ) | | ( aOutputs = = null ) ) {
return false ;
}
for ( ItemStack tStack : aOutputs ) {
if ( tStack ! = null ) {
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " pulveriser " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
2016-03-20 16:47:17 +01:00
GT_Recipe tRecipe = GT_Recipe . GT_Recipe_Map . sMaceratorRecipes . addRecipe ( true , new ItemStack [ ] { aInput } , aOutputs , null , aChances , null , null , aDuration , aEUt , 0 ) ;
if ( ( hidden ) & & ( tRecipe ! = null ) ) {
tRecipe . mHidden = true ;
}
2015-10-21 22:06:25 -04:00
return true ;
}
}
return false ;
}
@Override
public boolean addPyrolyseRecipe ( ItemStack aInput , FluidStack aFluidInput , int intCircuit , ItemStack aOutput , FluidStack aFluidOutput , int aDuration , int aEUt ) {
if ( aInput = = null ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " pyrolyse " , aInput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sPyrolyseRecipes . addRecipe ( false , new ItemStack [ ] { aInput , ItemList . Circuit_Integrated . getWithDamage ( 0L , intCircuit , new Object [ 0 ] ) } , new ItemStack [ ] { aOutput } , null , null , new FluidStack [ ] { aFluidInput } , new FluidStack [ ] { aFluidOutput } , aDuration , aEUt , 0 ) ;
return true ;
}
@Override
2017-05-24 23:59:42 +02:00
@Deprecated
2015-10-21 22:06:25 -04:00
public boolean addCrackingRecipe ( FluidStack aInput , FluidStack aOutput , int aDuration , int aEUt ) {
2017-05-24 23:59:42 +02:00
// if ((aInput == null) || (aOutput == null)) {
// return false;
// }
// if ((aDuration = GregTech_API.sRecipeFile.get("cracking", aInput.getUnlocalizedName(), aDuration)) <= 0) {
// return false;
// }
// GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput}, new FluidStack[]{aOutput}, aDuration, aEUt, 0);
// GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, GT_ModHandler.getSteam(aInput.amount)}, new FluidStack[]{aOutput, Materials.Hydrogen.getGas(aInput.amount)}, aDuration, aEUt, 0);
// GT_Recipe.GT_Recipe_Map.sCrakingRecipes.addRecipe(true, null, null, null, null, new FluidStack[]{aInput, Materials.Hydrogen.getGas(aInput.amount)}, new FluidStack[]{new FluidStack(aOutput.getFluid(), (int) (aOutput.amount * 1.3))}, aDuration, aEUt, 0);
// return true;
return false ;
}
@Override
public boolean addCrackingRecipe ( int circuitConfig , FluidStack aInput , FluidStack aInput2 , FluidStack aOutput , int aDuration , int aEUt ) {
if ( ( aInput = = null & & aInput2 = = null ) | | ( aOutput = = null ) ) {
2015-10-21 22:06:25 -04:00
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " cracking " , aInput . getUnlocalizedName ( ) , aDuration ) ) < = 0 ) {
return false ;
}
2017-05-24 23:59:42 +02:00
GT_Recipe . GT_Recipe_Map . sCrakingRecipes . addRecipe ( false , new ItemStack [ ] { GT_Utility . getIntegratedCircuit ( circuitConfig ) } , null , null , null ,
new FluidStack [ ] { aInput , aInput2 } , new FluidStack [ ] { aOutput } , aDuration , aEUt , 0 ) ;
2015-10-21 22:06:25 -04:00
return true ;
}
2017-05-24 23:59:42 +02:00
@Override
2016-06-30 22:17:18 +02:00
public boolean addAssemblylineRecipe ( ItemStack aResearchItem , int aResearchTime , ItemStack [ ] aInputs , FluidStack [ ] aFluidInputs , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aResearchItem = = null ) | | ( aResearchTime < = 0 ) | | ( aInputs = = null ) | | ( aOutput = = null ) | | aInputs . length > 15 | | aInputs . length < 4 ) {
2016-04-11 23:14:57 +02:00
return false ;
}
2016-06-30 22:17:18 +02:00
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " assemblingline " , aOutput , aDuration ) ) < = 0 ) {
2016-04-11 23:14:57 +02:00
return false ;
2016-06-30 22:17:18 +02:00
}
2016-10-22 16:38:18 +02:00
for ( ItemStack tItem : aInputs ) {
2017-06-25 11:42:48 +02:00
if ( tItem = = null ) {
System . out . println ( " addAssemblingLineRecipe " + aResearchItem . getDisplayName ( ) + " --> " + aOutput . getUnlocalizedName ( ) + " there is some null item in that recipe " ) ;
}
2016-10-22 16:38:18 +02:00
}
2017-06-25 11:42:48 +02:00
GT_Recipe . GT_Recipe_Map . sScannerFakeRecipes . addFakeRecipe ( false , new ItemStack [ ] { aResearchItem } , new ItemStack [ ] { aOutput } , new ItemStack [ ] { ItemList . Tool_DataStick . getWithName ( 1L , " Writes Research result " , new Object [ 0 ] ) } , null , null , aResearchTime , 30 , 0 ) ;
GT_Recipe . GT_Recipe_Map . sAssemblylineVisualRecipes . addFakeRecipe ( false , aInputs , new ItemStack [ ] { aOutput } , new ItemStack [ ] { ItemList . Tool_DataStick . getWithName ( 1L , " Reads Research result " , new Object [ 0 ] ) } , aFluidInputs , null , aDuration , aEUt , 0 , true ) ;
2016-06-30 22:17:18 +02:00
GT_Recipe . GT_Recipe_AssemblyLine . sAssemblylineRecipes . add ( new GT_Recipe_AssemblyLine ( aResearchItem , aResearchTime , aInputs , aFluidInputs , aOutput , aDuration , aEUt ) ) ;
2016-04-11 23:14:57 +02:00
return true ;
}
2017-02-28 02:04:47 +01:00
@Override
public boolean addCircuitAssemblerRecipe ( ItemStack [ ] aInputs , FluidStack aFluidInput , ItemStack aOutput , int aDuration , int aEUt ) {
if ( ( aInputs = = null ) | | ( aOutput = = null ) | | aInputs . length > 6 | | aInputs . length < 1 ) {
return false ;
}
if ( ( aDuration = GregTech_API . sRecipeFile . get ( " circuitassembler " , aOutput , aDuration ) ) < = 0 ) {
return false ;
}
GT_Recipe . GT_Recipe_Map . sCircuitAssemblerRecipes . addRecipe ( true , aInputs , new ItemStack [ ] { aOutput } , null , null , new FluidStack [ ] { aFluidInput } , null , aDuration , aEUt , 0 ) ;
return true ;
}
2017-05-30 02:10:13 +02:00
private boolean areItemsAndFluidsBothNull ( ItemStack [ ] items , FluidStack [ ] fluids ) {
boolean itemsNull = true ;
if ( items ! = null ) {
for ( ItemStack itemStack : items ) {
if ( itemStack ! = null ) {
itemsNull = false ;
break ;
}
}
}
boolean fluidsNull = true ;
if ( fluids ! = null ) {
for ( FluidStack fluidStack : fluids ) {
if ( fluidStack ! = null ) {
fluidsNull = false ;
break ;
}
}
}
return itemsNull & & fluidsNull ;
2016-03-20 16:47:17 +01:00
2017-05-30 02:10:13 +02:00
}
2016-03-20 16:47:17 +01:00
2017-08-19 10:43:07 +02:00
public boolean isAddingDeprecatedRecipes ( ) {
return isAddingDeprecatedRecipes ;
}
public void setIsAddingDeprecatedRecipes ( boolean isAddingDeprecatedRecipes ) {
this . isAddingDeprecatedRecipes = isAddingDeprecatedRecipes ;
}
2015-10-21 22:06:25 -04:00
}