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,106 @@ 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+ /*
92+ ModHandler.removeRecipeByOutput(basic);
93+ ModHandler.removeRecipeByOutput(gearbox);
94+ ModHandler.removeRecipeByOutput(hatch);
95+ ModHandler.removeRecipeByOutput(valve);
96+ ModHandler.removeRecipeByOutput(control);
97+ */
98+
99+ // == ADD ==
100+ // Farm Block
101+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
102+ .inputs (block .getBase ())
103+ .input (screw , Materials .Steel , 4 )
104+ .input (plate , Materials .Copper , 4 )
105+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .APATITE , 1 ))
106+ .circuitMeta (10 )
107+ .fluidInputs (Materials .Creosote .getFluid (500 ))
108+ .outputs (GTUtility .copy (4 , basic ))
109+ .EUt (20 )
110+ .duration (timeCarpenter (20 * feToEu ))
111+ .buildAndRegister ();
112+
113+ // Farm Control
114+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
115+ .inputs (GTUtility .copy (2 , basic ))
116+ .input (circuit , MarkerMaterials .Tier .LV , 2 )
117+ .input (MetaItems .ELECTRIC_MOTOR_LV )
118+ .input (cableGtSingle , Materials .Tin )
119+ .input (gear , Materials .Steel )
120+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .GOLD , 4 ))
121+ .circuitMeta (10 )
122+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
123+ .outputs (GTUtility .copy (2 , control ))
124+ .EUt (30 )
125+ .duration (timeCarpenter (2 * 30 * feToEu ))
126+ .buildAndRegister ();
127+
128+ // Gear Box
129+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
130+ .inputs (GTUtility .copy (2 , basic ))
131+ .input (MetaItems .ELECTRIC_MOTOR_LV )
132+ .input (gear , Materials .Steel , 4 )
133+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .BRONZE , 4 ))
134+ .circuitMeta (10 )
135+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
136+ .outputs (GTUtility .copy (2 , gearbox ))
137+ .EUt (30 )
138+ .duration (timeCarpenter (2 * 30 * feToEu ))
139+ .buildAndRegister ();
140+
141+ // Valve
142+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
143+ .inputs (GTUtility .copy (2 , basic ))
144+ .input (MetaItems .ELECTRIC_MOTOR_LV )
145+ .input (MetaItems .ELECTRIC_PUMP_LV )
146+ .input (gear , Materials .Steel , 1 )
147+ .input (ring , Materials .Rubber )
148+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .LAPIS , 4 ))
149+ .circuitMeta (10 )
150+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
151+ .outputs (GTUtility .copy (2 , valve ))
152+ .EUt (30 )
153+ .duration (timeCarpenter (2 * 30 * feToEu ))
154+ .buildAndRegister ();
155+
156+ // Hatch
157+ RecipeMaps .ASSEMBLER_RECIPES .recipeBuilder ()
158+ .inputs (GTUtility .copy (2 , basic ))
159+ .input (MetaItems .ELECTRIC_MOTOR_LV )
160+ .input (MetaItems .CONVEYOR_MODULE_LV , 2 )
161+ .input (gear , Materials .Steel )
162+ .input (Blocks .HOPPER )
163+ .inputs (ModuleCore .getItems ().tubes .get (EnumElectronTube .TIN , 4 ))
164+ .circuitMeta (10 )
165+ .fluidInputs (Materials .Creosote .getFluid (1000 ))
166+ .outputs (GTUtility .copy (2 , hatch ))
167+ .EUt (30 )
168+ .duration (timeCarpenter (2 * 30 * feToEu ))
169+ .buildAndRegister ();
170+ }
171+ }
54172}
0 commit comments