11package net .neganote .gtutilities .recipe ;
22
33import com .gregtechceu .gtceu .api .GTValues ;
4+ import com .gregtechceu .gtceu .common .data .GTItems ;
45
56import net .minecraft .data .recipes .FinishedRecipe ;
7+ import net .minecraft .world .item .ItemStack ;
68import net .neganote .gtutilities .config .UtilConfig ;
79
810import java .util .function .Consumer ;
911
1012import static com .gregtechceu .gtceu .common .data .GTRecipeTypes .ASSEMBLER_RECIPES ;
1113import static com .gregtechceu .gtceu .data .recipe .CraftingComponent .*;
14+ import static net .neganote .gtutilities .common .item .UtilItems .OMNITOOL ;
1215import static net .neganote .gtutilities .common .machine .UtilMachines .ENERGY_CONVERTER_64A ;
1316
1417public class UtilRecipes {
@@ -17,6 +20,10 @@ public static void init(Consumer<FinishedRecipe> provider) {
1720 if (UtilConfig .INSTANCE .features .converters64aEnabled ) {
1821 register64AConverterRecipes (provider );
1922 }
23+
24+ if (UtilConfig .INSTANCE .features .omnitoolEnabled ) {
25+ registerOmnitoolRecipe (provider );
26+ }
2027 }
2128
2229 public static void register64AConverterRecipes (Consumer <FinishedRecipe > provider ) {
@@ -31,4 +38,27 @@ public static void register64AConverterRecipes(Consumer<FinishedRecipe> provider
3138 .save (provider );
3239 }
3340 }
41+
42+ private static ItemStack getPowerUnit (int tier ) {
43+ return switch (tier ) {
44+ case GTValues .LV -> GTItems .POWER_UNIT_LV .asStack ();
45+ case GTValues .MV -> GTItems .POWER_UNIT_MV .asStack ();
46+ case GTValues .HV -> GTItems .POWER_UNIT_HV .asStack ();
47+ case GTValues .EV -> GTItems .POWER_UNIT_EV .asStack ();
48+ case GTValues .IV -> GTItems .POWER_UNIT_IV .asStack ();
49+ default -> throw new IllegalArgumentException ("Invalid tier of power unit: " + tier );
50+ };
51+ }
52+
53+ public static void registerOmnitoolRecipe (Consumer <FinishedRecipe > provider ) {
54+ ASSEMBLER_RECIPES .recipeBuilder ("omnitool" )
55+ .inputItems (getPowerUnit (UtilConfig .INSTANCE .features .omnitoolTier ))
56+ .inputItems (CIRCUIT .getIngredient (UtilConfig .INSTANCE .features .omnitoolTier ), 2 )
57+ .inputItems (EMITTER .getIngredient (UtilConfig .INSTANCE .features .omnitoolTier ), 1 )
58+ .inputItems (CABLE_QUAD .getIngredient (UtilConfig .INSTANCE .features .omnitoolTier ), 3 )
59+ .inputItems (MOTOR .getIngredient (UtilConfig .INSTANCE .features .omnitoolTier ), 2 )
60+ .outputItems (OMNITOOL )
61+ .EUt (GTValues .VEX [UtilConfig .INSTANCE .features .omnitoolTier ]).duration (20 * 60 )
62+ .save (provider );
63+ }
3464}
0 commit comments