|
1 | 1 | package net.deepacat.createpowerlines; |
2 | 2 |
|
3 | | -import com.google.common.collect.ImmutableList; |
4 | 3 | import com.gregtechceu.gtceu.api.GTCEuAPI; |
5 | 4 | import com.gregtechceu.gtceu.api.GTValues; |
6 | 5 | import com.gregtechceu.gtceu.api.addon.GTAddon; |
|
40 | 39 | import java.util.function.Consumer; |
41 | 40 |
|
42 | 41 | import static com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData.ITEM_MATERIAL_INFO; |
| 42 | +import static com.gregtechceu.gtceu.api.data.chemical.material.ItemMaterialData.getMaterialInfo; |
43 | 43 |
|
44 | 44 | @GTAddon |
45 | 45 | public class GTAddonImpl implements IGTAddon { |
@@ -105,78 +105,78 @@ public void addRecipes(Consumer<FinishedRecipe> out) { |
105 | 105 | ConnectorType[] connectors = this.connectors[i]; |
106 | 106 | if (connectors == null) continue; |
107 | 107 |
|
108 | | - ItemMaterialInfo hull = ITEM_MATERIAL_INFO.get(GTMachines.HULL[i].getBlock()); |
| 108 | + ItemMaterialInfo hull = getMaterialInfo(GTMachines.HULL[i].getBlock()); |
109 | 109 | List<MaterialStack> hullMats = hull.getMaterials(); |
110 | 110 |
|
111 | | -// Material gtWireMat = hullMats.get(1).material(); |
112 | | -// Material tierMat = hullMats.get(0).material(); |
113 | | -// |
114 | | -// TagKey<Item> hullPlate = ChemicalHelper.getTag(TagPrefix.plate, tierMat); |
115 | | -// TagKey<Item> wirePlate = ChemicalHelper.getTag(TagPrefix.plate, gtWireMat); |
116 | | -// |
117 | | -// WireMaterial wireMat = wireMats.get(gtWireMat); |
118 | | -// Object[] circuits = new Object[]{ |
119 | | -// CustomTags.CIRCUITS_ARRAY[i], |
120 | | -// GTMachines.ENERGY_CONVERTER_1A[i].getItem(), |
121 | | -// GTMachines.ENERGY_CONVERTER_4A[i].getItem(), |
122 | | -// GTMachines.ENERGY_CONVERTER_8A[i].getItem(), |
123 | | -// GTMachines.ENERGY_CONVERTER_16A[i].getItem() |
124 | | -// }; |
125 | | -// for (int j = 0; j < connectors.length; ++j) { |
126 | | -// ConnectorType connector = connectors[j]; |
127 | | -// VanillaRecipeHelper.addShapedRecipe(out, |
128 | | -// new ResourceLocation(CreatePowerlines.MODID, connector.id), connector.blockEntry.asStack(), |
129 | | -// "WWW", "PSP", "PCP", |
130 | | -// 'W', wirePlate, |
131 | | -// 'P', hullPlate, |
132 | | -// 'S', wireMat.spool.get(), 'C', circuits[j]); |
133 | | -// } |
| 111 | + Material gtWireMat = hullMats.get(0).material(); |
| 112 | + Material tierMat = hullMats.get(2).material(); |
| 113 | + |
| 114 | + TagKey<Item> hullPlate = ChemicalHelper.getTag(TagPrefix.plate, tierMat); |
| 115 | + TagKey<Item> wirePlate = ChemicalHelper.getTag(TagPrefix.plate, gtWireMat); |
| 116 | + |
| 117 | + WireMaterial wireMat = wireMats.get(gtWireMat); |
| 118 | + Object[] circuits = new Object[]{ |
| 119 | + CustomTags.CIRCUITS_ARRAY[i], |
| 120 | + GTMachines.ENERGY_CONVERTER_1A[i].getItem(), |
| 121 | + GTMachines.ENERGY_CONVERTER_4A[i].getItem(), |
| 122 | + GTMachines.ENERGY_CONVERTER_8A[i].getItem(), |
| 123 | + GTMachines.ENERGY_CONVERTER_16A[i].getItem() |
| 124 | + }; |
| 125 | + for (int j = 0; j < connectors.length; ++j) { |
| 126 | + ConnectorType connector = connectors[j]; |
| 127 | + VanillaRecipeHelper.addShapedRecipe(out, |
| 128 | + new ResourceLocation(CreatePowerlines.MODID, connector.id), connector.blockEntry.asStack(), |
| 129 | + "WWW", "PSP", "PCP", |
| 130 | + 'W', wirePlate, |
| 131 | + 'P', hullPlate, |
| 132 | + 'S', wireMat.spool.get(), 'C', circuits[j]); |
| 133 | + } |
134 | 134 | } |
135 | 135 | } |
136 | 136 |
|
137 | 137 | if (connectors == null) return; |
138 | 138 |
|
139 | | -// if (Config.GT_WIRE_RECIPES.get()) { |
140 | | -// for (Map.Entry<Material, WireMaterial> entry : wireMats.entrySet()) { |
141 | | -// Material gtWireMat = entry.getKey(); |
142 | | -// WireMaterial wireMat = entry.getValue(); |
143 | | -// GTRecipeTypes.WIREMILL_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "wires/" + wireMat.wireId())) |
144 | | -// .inputItems(TagPrefix.ingot, gtWireMat) |
145 | | -// .outputItems(new ItemStack(wireMat.wire.get(), 2)) |
146 | | -// .circuitMeta(5).duration(200).EUt(7).save(out); |
147 | | -// VanillaRecipeHelper.addShapedRecipe(out, |
148 | | -// new ResourceLocation(CreatePowerlines.MODID, "spools/" + wireMat.spoolId()), |
149 | | -// new ItemStack(wireMat.spool.get()), |
150 | | -// "WWW", "WSW", "WWW", |
151 | | -// 'S', WireMaterials.EMPTY_SPOOL.get(), |
152 | | -// 'W', wireMat.wire.get()); |
153 | | -// } |
154 | | -// } |
155 | | -// |
156 | | -// // Gregged spool manual recipe |
157 | | -// VanillaRecipeHelper.addShapedRecipe(out, |
158 | | -// new ResourceLocation(CreatePowerlines.MODID, "empty_spool"), WireMaterials.EMPTY_SPOOL.asStack(2), |
159 | | -// "III", " N ", "III", |
160 | | -// 'I', new MaterialEntry(TagPrefix.ingot, GTMaterials.Iron), |
161 | | -// 'N', new MaterialEntry(TagPrefix.nugget, GTMaterials.Iron) |
162 | | -// ); |
163 | | -// |
164 | | -// // Gregged relay manual recipe |
165 | | -// int outAmt = 1; |
166 | | -// for (FluidStack fluid : new FluidStack[]{ |
167 | | -// GTMaterials.Polyethylene.getFluid(1152), |
168 | | -// GTMaterials.Polytetrafluoroethylene.getFluid(576), |
169 | | -// GTMaterials.Polybenzimidazole.getFluid(288) |
170 | | -// }) { |
171 | | -// String fluidName = ForgeRegistries.FLUIDS.getKey(fluid.getFluid()).getPath(); |
172 | | -// GTRecipeTypes.ASSEMBLER_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "relay/" + fluidName)) |
173 | | -// .inputItems(TagPrefix.wireGtOctal, GTMaterials.Copper) |
174 | | -// .inputItems(TagPrefix.plateDense, GTMaterials.Steel, 2) |
175 | | -// .inputItems(GTMachines.HULL[1]) |
176 | | -// .inputFluids(fluid) |
177 | | -// .outputItems(ConnectorTypes.RELAY.blockEntry.asStack(outAmt)) |
178 | | -// .circuitMeta(1).duration(200).EUt(7).save(out); |
179 | | -// outAmt *= 2; |
180 | | -// } |
| 139 | + if (Config.GT_WIRE_RECIPES.get()) { |
| 140 | + for (Map.Entry<Material, WireMaterial> entry : wireMats.entrySet()) { |
| 141 | + Material gtWireMat = entry.getKey(); |
| 142 | + WireMaterial wireMat = entry.getValue(); |
| 143 | + GTRecipeTypes.WIREMILL_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "wires/" + wireMat.wireId())) |
| 144 | + .inputItems(TagPrefix.ingot, gtWireMat) |
| 145 | + .outputItems(new ItemStack(wireMat.wire.get(), 2)) |
| 146 | + .circuitMeta(5).duration(200).EUt(7).save(out); |
| 147 | + VanillaRecipeHelper.addShapedRecipe(out, |
| 148 | + new ResourceLocation(CreatePowerlines.MODID, "spools/" + wireMat.spoolId()), |
| 149 | + new ItemStack(wireMat.spool.get()), |
| 150 | + "WWW", "WSW", "WWW", |
| 151 | + 'S', WireMaterials.EMPTY_SPOOL.get(), |
| 152 | + 'W', wireMat.wire.get()); |
| 153 | + } |
| 154 | + } |
| 155 | + |
| 156 | + // Gregged spool manual recipe |
| 157 | + VanillaRecipeHelper.addShapedRecipe(out, |
| 158 | + new ResourceLocation(CreatePowerlines.MODID, "empty_spool"), WireMaterials.EMPTY_SPOOL.asStack(2), |
| 159 | + "III", " N ", "III", |
| 160 | + 'I', new MaterialEntry(TagPrefix.ingot, GTMaterials.Iron), |
| 161 | + 'N', new MaterialEntry(TagPrefix.nugget, GTMaterials.Iron) |
| 162 | + ); |
| 163 | + |
| 164 | + // Gregged relay manual recipe |
| 165 | + int outAmt = 1; |
| 166 | + for (FluidStack fluid : new FluidStack[]{ |
| 167 | + GTMaterials.Polyethylene.getFluid(1152), |
| 168 | + GTMaterials.Polytetrafluoroethylene.getFluid(576), |
| 169 | + GTMaterials.Polybenzimidazole.getFluid(288) |
| 170 | + }) { |
| 171 | + String fluidName = ForgeRegistries.FLUIDS.getKey(fluid.getFluid()).getPath(); |
| 172 | + GTRecipeTypes.ASSEMBLER_RECIPES.recipeBuilder(new ResourceLocation(CreatePowerlines.MODID, "relay/" + fluidName)) |
| 173 | + .inputItems(TagPrefix.wireGtOctal, GTMaterials.Copper) |
| 174 | + .inputItems(TagPrefix.plateDense, GTMaterials.Steel, 2) |
| 175 | + .inputItems(GTMachines.HULL[1]) |
| 176 | + .inputFluids(fluid) |
| 177 | + .outputItems(ConnectorTypes.RELAY.blockEntry.asStack(outAmt)) |
| 178 | + .circuitMeta(1).duration(200).EUt(7).save(out); |
| 179 | + outAmt *= 2; |
| 180 | + } |
181 | 181 | } |
182 | 182 | } |
0 commit comments