11package com .github .gtexpert .gtbm .integration .forestry .recipes ;
22
3+ import static com .github .gtexpert .gtbm .integration .forestry .ForestryUtility .feToEu ;
4+ import static com .github .gtexpert .gtbm .integration .forestry .ForestryUtility .timeCarpenter ;
5+ import static forestry .farming .ModuleFarming .getBlocks ;
36import static gregtech .api .unification .ore .OrePrefix .*;
47
58import net .minecraft .init .Blocks ;
69import net .minecraft .init .Items ;
710import net .minecraft .item .ItemStack ;
11+ import net .minecraft .nbt .NBTTagCompound ;
812
913import gregtech .api .recipes .ModHandler ;
1014import gregtech .api .recipes .RecipeMaps ;
15+ import gregtech .api .unification .material .MarkerMaterials ;
1116import gregtech .api .unification .material .Materials ;
17+ import gregtech .api .util .GTUtility ;
1218import gregtech .common .ConfigHolder ;
19+ import gregtech .common .items .MetaItems ;
1320
1421import com .github .gtexpert .gtbm .api .util .Mods ;
1522
23+ import forestry .core .ModuleCore ;
24+ import forestry .core .items .EnumElectronTube ;
25+ import forestry .farming .blocks .BlockRegistryFarming ;
26+ import forestry .farming .blocks .EnumFarmBlockType ;
27+ import forestry .farming .models .EnumFarmBlockTexture ;
28+
1629public class FFMBlockRecipe {
1730
1831 public static void init () {
@@ -22,6 +35,9 @@ public static void init() {
2235 if (Mods .ForestryCharcoal .isModLoaded ()) {
2336 blockCharcoal ();
2437 }
38+ if (Mods .ForestryFarming .isModLoaded ()) {
39+ farm ();
40+ }
2541 }
2642
2743 public static void blockCore () {
@@ -51,4 +67,104 @@ public static void blockCharcoal() {
5167 .outputs (Mods .Forestry .getItem ("loam" , 4 ))
5268 .duration (200 ).EUt (16 ).buildAndRegister ();
5369 }
70+
71+ public static void farm () {
72+ BlockRegistryFarming blocks = getBlocks ();
73+
74+ ItemStack basic = blocks .farm .get (EnumFarmBlockType .PLAIN , 1 );
75+ ItemStack gearbox = blocks .farm .get (EnumFarmBlockType .GEARBOX , 1 );
76+ ItemStack hatch = blocks .farm .get (EnumFarmBlockType .HATCH , 1 );
77+ ItemStack valve = blocks .farm .get (EnumFarmBlockType .VALVE , 1 );
78+ ItemStack control = blocks .farm .get (EnumFarmBlockType .CONTROL , 1 );
79+
80+ for (EnumFarmBlockTexture block : EnumFarmBlockTexture .values ()) {
81+ NBTTagCompound compound = new NBTTagCompound ();
82+ block .saveToCompound (compound );
83+
84+ basic .setTagCompound (compound );
85+ gearbox .setTagCompound (compound );
86+ hatch .setTagCompound (compound );
87+ valve .setTagCompound (compound );
88+ control .setTagCompound (compound );
89+
90+ // == REMOVE ==
91+ ModHandler .removeRecipeByOutput (basic );
92+ ModHandler .removeRecipeByOutput (gearbox );
93+ ModHandler .removeRecipeByOutput (hatch );
94+ ModHandler .removeRecipeByOutput (valve );
95+ ModHandler .removeRecipeByOutput (control );
96+
97+ // == ADD ==
98+ // Farm Block
99+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
100+ .inputs (block .getBase ())
101+ .input (screw , Materials .Steel , 4 )
102+ .input (plate , Materials .Copper , 4 )
103+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .APATITE , 1 ))
104+ .circuitMeta (10 )
105+ .fluidInputs (Materials .Creosote .getFluid (500 ))
106+ .outputs (GTUtility .copy (4 , basic ))
107+ .EUt (20 )
108+ .duration (timeCarpenter (20 * feToEu ))
109+ .buildAndRegister ();
110+
111+ // Farm Control
112+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
113+ .inputs (GTUtility .copy (2 , basic ))
114+ .input (circuit , MarkerMaterials .Tier .LV , 2 )
115+ .input (MetaItems .ELECTRIC_MOTOR_LV )
116+ .input (cableGtSingle , Materials .Tin )
117+ .input (gear , Materials .Steel )
118+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .GOLD , 4 ))
119+ .circuitMeta (11 )
120+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
121+ .outputs (GTUtility .copy (2 , control ))
122+ .EUt (30 )
123+ .duration (timeCarpenter (2 * 30 * feToEu ))
124+ .buildAndRegister ();
125+
126+ // Gear Box
127+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
128+ .inputs (GTUtility .copy (2 , basic ))
129+ .input (MetaItems .ELECTRIC_MOTOR_LV )
130+ .input (gear , Materials .Steel , 4 )
131+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .BRONZE , 4 ))
132+ .circuitMeta (12 )
133+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
134+ .outputs (GTUtility .copy (2 , gearbox ))
135+ .EUt (30 )
136+ .duration (timeCarpenter (2 * 30 * feToEu ))
137+ .buildAndRegister ();
138+
139+ // Valve
140+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
141+ .inputs (GTUtility .copy (2 , basic ))
142+ .input (MetaItems .ELECTRIC_MOTOR_LV )
143+ .input (MetaItems .ELECTRIC_PUMP_LV )
144+ .input (gear , Materials .Steel , 1 )
145+ .input (ring , Materials .Rubber )
146+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .LAPIS , 4 ))
147+ .circuitMeta (13 )
148+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
149+ .outputs (GTUtility .copy (2 , valve ))
150+ .EUt (30 )
151+ .duration (timeCarpenter (2 * 30 * feToEu ))
152+ .buildAndRegister ();
153+
154+ // Hatch
155+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
156+ .inputs (GTUtility .copy (2 , basic ))
157+ .input (MetaItems .ELECTRIC_MOTOR_LV )
158+ .input (MetaItems .CONVEYOR_MODULE_LV , 2 )
159+ .input (gear , Materials .Steel )
160+ .input (Blocks .HOPPER )
161+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .TIN , 4 ))
162+ .circuitMeta (14 )
163+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
164+ .outputs (GTUtility .copy (2 , hatch ))
165+ .EUt (30 )
166+ .duration (timeCarpenter (2 * 30 * feToEu ))
167+ .buildAndRegister ();
168+ }
169+ }
54170}
0 commit comments