11package net .htmlcsjs .htmlTech .loaders .recipe ;
22
3+ import gregtech .api .items .metaitem .MetaItem ;
34import gregtech .api .recipes .ingredients .IntCircuitIngredient ;
45import gregtech .api .unification .material .MarkerMaterials ;
56import gregtech .api .unification .stack .UnificationEntry ;
67import gregtech .common .blocks .BlockMetalCasing ;
78import gregtech .loaders .recipe .CraftingComponent ;
9+ import net .htmlcsjs .htmlTech .HtmlTech ;
810import net .htmlcsjs .htmlTech .common .HTConfig ;
911import net .htmlcsjs .htmlTech .common .blocks .BlockHTCasing ;
1012import net .minecraft .item .ItemStack ;
@@ -51,19 +53,33 @@ public static void init() {
5153
5254 // Laser Collecting hatches
5355 for (int i = HTConfig .lasers .minLaserTier ; i < mteLength ; i ++) {
54- ASSEMBLY_LINE_RECIPES .recipeBuilder ()
55- .input (HULL [i ])
56- .input (lens , Glass )
57- .inputs ((ItemStack ) CraftingComponent .SENSOR .getIngredient (i ))
58- .inputs ((ItemStack ) CraftingComponent .VOLTAGE_COIL .getIngredient (i ))
59- .input (wireGtQuadruple , ((UnificationEntry ) CraftingComponent .CABLE_QUAD .getIngredient (i )).material , 4 )
60- .input (foil , ((UnificationEntry ) CraftingComponent .PLATE .getIngredient (i )).material , 4 )
61- .input (circuit , ((UnificationEntry ) CraftingComponent .CIRCUIT .getIngredient (i )).material )
62- .fluidInputs (SodiumPotassium .getFluid (1000 ))
63- .output (LASER_INPUT_HATCHES [i ])
64- .EUt (VA [i ])
65- .duration (100 )
66- .buildAndRegister ();
56+ ItemStack coil ;
57+ if (CraftingComponent .VOLTAGE_COIL .getIngredient (i ) instanceof ItemStack ) {
58+ coil = (ItemStack ) CraftingComponent .VOLTAGE_COIL .getIngredient (i );
59+ } else if (CraftingComponent .VOLTAGE_COIL .getIngredient (i ) instanceof MetaItem .MetaValueItem ) {
60+ coil = ((MetaItem <?>.MetaValueItem ) CraftingComponent .VOLTAGE_COIL .getIngredient (i )).getStackForm ();
61+ } else {
62+ HtmlTech .logger .warn (String .format ("Cannot add recipe for %s hatch" , VN [i ]));
63+ continue ;
64+ }
65+ try {
66+ Object sensor = !HT && i == UHV ? CraftingComponent .SENSOR .getIngredient (i - 1 ) : CraftingComponent .SENSOR .getIngredient (i );
67+ ASSEMBLY_LINE_RECIPES .recipeBuilder ()
68+ .input (HULL [i ])
69+ .input (lens , Glass )
70+ .inputs ((ItemStack ) sensor )
71+ .inputs (coil )
72+ .input (wireGtQuadruple , ((UnificationEntry ) CraftingComponent .CABLE_QUAD .getIngredient (i )).material , 4 )
73+ .input (foil , ((UnificationEntry ) CraftingComponent .PLATE .getIngredient (i )).material , 4 )
74+ .input (circuit , ((UnificationEntry ) CraftingComponent .CIRCUIT .getIngredient (i )).material )
75+ .fluidInputs (SodiumPotassium .getFluid (1000 ))
76+ .output (LASER_INPUT_HATCHES [i ])
77+ .EUt (VA [i ])
78+ .duration (100 )
79+ .buildAndRegister ();
80+ } catch (NullPointerException ignored ) {
81+ HtmlTech .logger .warn (String .format ("Cannot add recipe for %s hatch" , VN [i ]));
82+ }
6783 }
6884
6985 // Laser Emitter hatch
@@ -91,7 +107,7 @@ public static void init() {
91107 .input (circuit , MarkerMaterials .Tier .ZPM )
92108 .input (circuit , MarkerMaterials .Tier .ZPM )
93109 .fluidInputs (SodiumPotassium .getFluid (1000 ))
94- .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
110+ .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
95111 .output (LASER_PROJECTOR )
96112 //.reserchItem(LASER_OUTPUT_HATCH)
97113 .EUt (VA [ZPM ])
@@ -110,7 +126,7 @@ public static void init() {
110126 .input (circuit , MarkerMaterials .Tier .ZPM )
111127 .input (circuit , MarkerMaterials .Tier .ZPM )
112128 .fluidInputs (SodiumPotassium .getFluid (1000 ))
113- .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
129+ .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
114130 .output (LASER_COLLECTOR )
115131 //.reserchItem(LASER_INPUT_HATCHES[LuV])
116132 .EUt (VA [ZPM ])
@@ -121,7 +137,7 @@ public static void init() {
121137 ASSEMBLER_RECIPES .recipeBuilder ()
122138 .input (GLASS_TUBE )
123139 .input (lens , Glass )
124- .fluidInputs (Silver .getFluid (4 * L ))
140+ .fluidInputs (Silver .getFluid (4 * L ))
125141 .output (EMPTY_LASER )
126142 .EUt (VA [EV ])
127143 .duration (20 )
0 commit comments