|
16 | 16 |
|
17 | 17 | import com.brandon3055.draconicevolution.DEFeatures; |
18 | 18 |
|
19 | | -import gregtech.api.GTValues; |
20 | 19 | import gregtech.api.GregTechAPI; |
21 | 20 | import gregtech.api.metatileentity.multiblock.CleanroomType; |
22 | 21 | import gregtech.api.recipes.ModHandler; |
23 | 22 | import gregtech.api.recipes.RecipeBuilder; |
24 | 23 | import gregtech.api.recipes.RecipeMaps; |
25 | | -import gregtech.api.recipes.builders.BlastRecipeBuilder; |
26 | | -import gregtech.api.recipes.ingredients.IntCircuitIngredient; |
27 | 24 | import gregtech.api.unification.OreDictUnifier; |
28 | 25 | import gregtech.api.unification.material.Material; |
29 | 26 | import gregtech.api.unification.material.Materials; |
30 | 27 | import gregtech.api.unification.material.properties.BlastProperty; |
31 | 28 | import gregtech.api.unification.material.properties.PropertyKey; |
32 | | -import gregtech.api.unification.ore.OrePrefix; |
33 | | -import gregtech.api.unification.stack.MaterialStack; |
34 | 29 | import gregtech.common.ConfigHolder; |
35 | 30 | import gregtech.common.blocks.MetaBlocks; |
36 | 31 | import gregtech.common.items.MetaItems; |
37 | 32 |
|
38 | 33 | import gregicality.multiblocks.api.fluids.GCYMFluidStorageKeys; |
39 | | -import gregicality.multiblocks.api.recipes.GCYMRecipeMaps; |
40 | | -import gregicality.multiblocks.api.unification.GCYMMaterialFlags; |
41 | 34 | import gregicality.multiblocks.api.unification.properties.GCYMPropertyKey; |
42 | 35 |
|
43 | 36 | import com.github.gtexpert.core.api.GTEValues; |
@@ -154,7 +147,6 @@ public static void init() { |
154 | 147 | // Extended recipes |
155 | 148 | List<Material> materials = new ArrayList<>(GregTechAPI.materialManager.getRegisteredMaterials()); |
156 | 149 | materials.forEach(DraconicMaterialsRecipe::vacuumFreezerExtended); |
157 | | - materials.forEach(DraconicMaterialsRecipe::alloyBlastFurnaceExtended); |
158 | 150 | } |
159 | 151 |
|
160 | 152 | /** |
@@ -242,149 +234,6 @@ private static void vacuumFreezerExtended(@NotNull Material material) { |
242 | 234 | } |
243 | 235 | } |
244 | 236 |
|
245 | | - private static void alloyBlastFurnaceExtended(Material material) { |
246 | | - // Do not generate for disabled materials |
247 | | - if (material.hasFlag(GCYMMaterialFlags.NO_ALLOY_BLAST_RECIPES)) return; |
248 | | - |
249 | | - // Check if the material has a blast recipe |
250 | | - if (!material.hasProperty(GCYMPropertyKey.ALLOY_BLAST)) return; |
251 | | - |
252 | | - // Check if the material has a molten fluid |
253 | | - Fluid molten = material.getFluid(GCYMFluidStorageKeys.MOLTEN); |
254 | | - if (molten == null) return; |
255 | | - |
256 | | - // Get the vacuum freezer EUt and duration |
257 | | - BlastProperty property = material.getProperty(PropertyKey.BLAST); |
258 | | - |
259 | | - produce(material, property); |
260 | | - } |
261 | | - |
262 | | - /** |
263 | | - * Generates alloy blast recipes for a material |
264 | | - * |
265 | | - * @param material the material to generate for |
266 | | - * @param blastProperty the blast property of the material |
267 | | - */ |
268 | | - private static void produce(@NotNull Material material, @NotNull BlastProperty blastProperty) { |
269 | | - final int componentAmount = material.getMaterialComponents().size(); |
270 | | - |
271 | | - // ignore non-alloys |
272 | | - if (componentAmount < 2) return; |
273 | | - |
274 | | - // get the output fluid |
275 | | - Fluid molten = material.getFluid(GCYMFluidStorageKeys.MOLTEN); |
276 | | - if (molten == null) return; |
277 | | - |
278 | | - RecipeBuilder<BlastRecipeBuilder> builder = createBuilder(blastProperty, material); |
279 | | - |
280 | | - int outputAmount = addInputs(material, builder); |
281 | | - if (outputAmount <= 0) return; |
282 | | - |
283 | | - buildRecipes(blastProperty, molten, outputAmount, componentAmount, builder); |
284 | | - } |
285 | | - |
286 | | - /** |
287 | | - * Creates the recipeBuilder with duration and EUt |
288 | | - * |
289 | | - * @param property the blast property of the material |
290 | | - * @param material the material |
291 | | - * @return the builder |
292 | | - */ |
293 | | - @SuppressWarnings("MethodMayBeStatic") |
294 | | - private static @NotNull BlastRecipeBuilder createBuilder(@NotNull BlastProperty property, |
295 | | - @NotNull Material material) { |
296 | | - BlastRecipeBuilder builder = GCYMRecipeMaps.ALLOY_BLAST_RECIPES.recipeBuilder(); |
297 | | - // apply the duration override |
298 | | - int duration = property.getDurationOverride(); |
299 | | - if (duration < 0) duration = Math.max(1, (int) (material.getMass() * property.getBlastTemperature() / 100L)); |
300 | | - builder.duration(duration); |
301 | | - |
302 | | - // apply the EUt override |
303 | | - int EUt = property.getEUtOverride(); |
304 | | - if (EUt < 0) EUt = GTValues.VA[GTValues.MV]; |
305 | | - builder.EUt(EUt); |
306 | | - |
307 | | - return builder.blastFurnaceTemp(property.getBlastTemperature()); |
308 | | - } |
309 | | - |
310 | | - /** |
311 | | - * @param material the material to start recipes for |
312 | | - * @param builder the recipe builder to append to |
313 | | - * @return the outputAmount if the recipe is valid, otherwise -1 |
314 | | - */ |
315 | | - private static int addInputs(@NotNull Material material, @NotNull RecipeBuilder<BlastRecipeBuilder> builder) { |
316 | | - // calculate the output amount and add inputs |
317 | | - int outputAmount = 0; |
318 | | - int fluidAmount = 0; |
319 | | - int dustAmount = 0; |
320 | | - for (MaterialStack materialStack : material.getMaterialComponents()) { |
321 | | - final Material msMat = materialStack.material; |
322 | | - final int msAmount = (int) materialStack.amount; |
323 | | - |
324 | | - if (msMat.hasProperty(PropertyKey.DUST)) { |
325 | | - if (dustAmount >= 9) return -1; // more than 9 dusts won't fit in the machine |
326 | | - dustAmount++; |
327 | | - builder.input(OrePrefix.dust, msMat, msAmount); |
328 | | - } else if (msMat.hasProperty(PropertyKey.FLUID)) { |
329 | | - if (fluidAmount >= 2) return -1; // more than 2 fluids won't fit in the machine |
330 | | - fluidAmount++; |
331 | | - // assume all fluids have 1000mB/mol, since other quantities should be as an item input |
332 | | - builder.fluidInputs(msMat.getFluid(1000 * msAmount)); |
333 | | - } else return -1; // no fluid or item prop means no valid recipe |
334 | | - outputAmount += msAmount; |
335 | | - } |
336 | | - return outputAmount; |
337 | | - } |
338 | | - |
339 | | - /** |
340 | | - * Builds the alloy blast recipes |
341 | | - * |
342 | | - * @param property the blast property to utilize |
343 | | - * @param molten the molten fluid |
344 | | - * @param outputAmount the amount of material to output |
345 | | - * @param componentAmount the amount of different components in the material |
346 | | - * @param builder the builder to continue |
347 | | - */ |
348 | | - private static void buildRecipes(@NotNull BlastProperty property, @NotNull Fluid molten, int outputAmount, |
349 | | - int componentAmount, |
350 | | - @NotNull RecipeBuilder<BlastRecipeBuilder> builder) { |
351 | | - // add the fluid output with the correct amount |
352 | | - builder.fluidOutputs(new FluidStack(molten, GTValues.L * outputAmount)); |
353 | | - |
354 | | - // apply alloy blast duration reduction: 3/4 |
355 | | - int duration = builder.getDuration() * outputAmount * 3 / 4; |
356 | | - |
357 | | - // build the gas recipe if it exists |
358 | | - if (property.getGasTier() != null) { |
359 | | - RecipeBuilder<BlastRecipeBuilder> builderGas = builder.copy(); |
360 | | - builderGas.notConsumable(new IntCircuitIngredient(getGasCircuitNum(componentAmount))) |
361 | | - .fluidInputs(GTEMaterials.Pyrotheum.getFluid(GCYMFluidStorageKeys.MOLTEN, ABFPyrotheumAmount)) |
362 | | - .duration((int) (duration * 0.67 * ABFDurationMultiplier)) |
363 | | - .buildAndRegister(); |
364 | | - } |
365 | | - |
366 | | - // build the non-gas recipe |
367 | | - builder.notConsumable(new IntCircuitIngredient(getCircuitNum(componentAmount))) |
368 | | - .duration(duration) |
369 | | - .buildAndRegister(); |
370 | | - } |
371 | | - |
372 | | - /** |
373 | | - * @param componentAmount the amount of different components in the material |
374 | | - * @return the circuit number for the regular recipe |
375 | | - */ |
376 | | - private static int getCircuitNum(int componentAmount) { |
377 | | - return componentAmount; |
378 | | - } |
379 | | - |
380 | | - /** |
381 | | - * @param componentAmount the amount of different components in the material |
382 | | - * @return the circuit number for the gas-boosted recipe |
383 | | - */ |
384 | | - private static int getGasCircuitNum(int componentAmount) { |
385 | | - return componentAmount + 11; |
386 | | - } |
387 | | - |
388 | 237 | public static void remove() { |
389 | 238 | // Draconium Ore |
390 | 239 | ModHandler.removeFurnaceSmelting(Mods.DraconicEvolution.getItem("draconium_ore", 1)); |
|
0 commit comments