1
1
package net .htmlcsjs .htmlTech .loaders .recipe ;
2
2
3
+ import gregtech .api .items .metaitem .MetaItem ;
3
4
import gregtech .api .recipes .ingredients .IntCircuitIngredient ;
4
5
import gregtech .api .unification .material .MarkerMaterials ;
5
6
import gregtech .api .unification .stack .UnificationEntry ;
6
7
import gregtech .common .blocks .BlockMetalCasing ;
7
8
import gregtech .loaders .recipe .CraftingComponent ;
9
+ import net .htmlcsjs .htmlTech .HtmlTech ;
8
10
import net .htmlcsjs .htmlTech .common .HTConfig ;
9
11
import net .htmlcsjs .htmlTech .common .blocks .BlockHTCasing ;
10
12
import net .minecraft .item .ItemStack ;
@@ -51,19 +53,33 @@ public static void init() {
51
53
52
54
// Laser Collecting hatches
53
55
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
+ }
67
83
}
68
84
69
85
// Laser Emitter hatch
@@ -91,7 +107,7 @@ public static void init() {
91
107
.input (circuit , MarkerMaterials .Tier .ZPM )
92
108
.input (circuit , MarkerMaterials .Tier .ZPM )
93
109
.fluidInputs (SodiumPotassium .getFluid (1000 ))
94
- .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
110
+ .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
95
111
.output (LASER_PROJECTOR )
96
112
//.reserchItem(LASER_OUTPUT_HATCH)
97
113
.EUt (VA [ZPM ])
@@ -110,7 +126,7 @@ public static void init() {
110
126
.input (circuit , MarkerMaterials .Tier .ZPM )
111
127
.input (circuit , MarkerMaterials .Tier .ZPM )
112
128
.fluidInputs (SodiumPotassium .getFluid (1000 ))
113
- .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
129
+ .fluidInputs (SolderingAlloy .getFluid (L * 7 ))
114
130
.output (LASER_COLLECTOR )
115
131
//.reserchItem(LASER_INPUT_HATCHES[LuV])
116
132
.EUt (VA [ZPM ])
@@ -121,7 +137,7 @@ public static void init() {
121
137
ASSEMBLER_RECIPES .recipeBuilder ()
122
138
.input (GLASS_TUBE )
123
139
.input (lens , Glass )
124
- .fluidInputs (Silver .getFluid (4 * L ))
140
+ .fluidInputs (Silver .getFluid (4 * L ))
125
141
.output (EMPTY_LASER )
126
142
.EUt (VA [EV ])
127
143
.duration (20 )
0 commit comments