11package com .github .gtexpert .core .loaders .recipe ;
22
33import static gregtech .api .GTValues .*;
4- import static gregtech .api .unification .material .info .MaterialFlags .*;
54import static gregtech .api .unification .ore .OrePrefix .*;
5+ import static gregtech .common .items .MetaItems .ULTIMATE_BATTERY ;
6+ import static gregtech .loaders .recipe .handlers .ToolRecipeHandler .batteryItems ;
67
7- import java .util .ArrayList ;
8+ import java .util .Collections ;
89import java .util .List ;
910
1011import net .minecraft .init .Blocks ;
1112import net .minecraft .init .Items ;
1213import net .minecraft .item .EnumDyeColor ;
1314import net .minecraft .item .ItemStack ;
14- import net .minecraftforge .fluids .Fluid ;
1515import net .minecraftforge .fluids .FluidStack ;
1616
17- import org .jetbrains .annotations .NotNull ;
18-
19- import gregtech .api .GregTechAPI ;
20- import gregtech .api .fluids .store .FluidStorageKeys ;
17+ import gregtech .api .GTValues ;
2118import gregtech .api .items .OreDictNames ;
19+ import gregtech .api .items .metaitem .MetaItem ;
2220import gregtech .api .recipes .GTRecipeHandler ;
2321import gregtech .api .recipes .ModHandler ;
2422import gregtech .api .recipes .RecipeMaps ;
2523import gregtech .api .recipes .category .RecipeCategories ;
2624import gregtech .api .recipes .ingredients .IntCircuitIngredient ;
2725import gregtech .api .unification .OreDictUnifier ;
28- import gregtech .api .unification .material .Material ;
2926import gregtech .api .unification .material .Materials ;
30- import gregtech .api .unification .material .properties .BlastProperty ;
31- import gregtech .api .unification .material .properties .PropertyKey ;
32- import gregtech .api .unification .ore .OrePrefix ;
3327import gregtech .api .unification .stack .UnificationEntry ;
3428import gregtech .common .ConfigHolder ;
3529import gregtech .common .items .MetaItems ;
3630import gregtech .common .metatileentities .MetaTileEntities ;
3731
38- import gregicality .multiblocks .api .fluids .GCYMFluidStorageKeys ;
39- import gregicality .multiblocks .api .unification .properties .GCYMPropertyKey ;
40-
4132import com .github .gtexpert .core .common .items .GTEMetaItems ;
4233
4334public class CEUOverrideRecipe {
@@ -50,13 +41,6 @@ public static void init() {
5041 }
5142
5243 private static void materials () {
53- // Vacuum Freezer
54- List <Material > materials = new ArrayList <>(GregTechAPI .materialManager .getRegisteredMaterials ());
55- materials .forEach (CEUOverrideRecipe ::vacuumFreezerExtended );
56-
57- // Remove Gem
58- materials .forEach (CEUOverrideRecipe ::removeGem );
59-
6044 // Iron Nugget
6145 ModHandler .addShapelessRecipe ("wrought_iron_nugget" , OreDictUnifier .get (nugget , Materials .Iron , 9 ),
6246 OreDictUnifier .get (ingot , Materials .Iron , 1 ));
@@ -241,6 +225,16 @@ private static void items() {
241225 .category (RecipeCategories .MACERATOR_RECYCLING )
242226 .duration (1470 ).EUt (2 )
243227 .buildAndRegister ();
228+
229+ batteryItems .put (GTValues .UHV , Collections .singletonList (ULTIMATE_BATTERY ));
230+ for (int i = GTValues .ULV ; i < GTValues .UEV ; i ++) {
231+ List <MetaItem .MetaValueItem > tieredBatteryItems = batteryItems .get (i );
232+ for (MetaItem .MetaValueItem batteryItem : tieredBatteryItems ) {
233+ ItemStack batteryStack = batteryItem .getStackForm ();
234+ String recipeName = String .format ("nbt_clearing_%s" , batteryItem .unlocalizedName );
235+ ModHandler .addShapelessNBTClearingRecipe (recipeName , batteryStack , batteryStack );
236+ }
237+ }
244238 }
245239
246240 private static void blocks () {
@@ -367,142 +361,4 @@ private static void tools() {
367361 'P' , MetaItems .CARBON_FIBER_PLATE .getStackForm (),
368362 'E' , MetaItems .ENERGIUM_CRYSTAL .getStackForm ());
369363 }
370-
371- /**
372- * Vacuum Freezer to extended recipes
373- *
374- * @param material The material to add recipes for
375- */
376- private static void vacuumFreezerExtended (@ NotNull Material material ) {
377- // Check if the material has a blast recipe
378- if (!material .hasProperty (GCYMPropertyKey .ALLOY_BLAST )) return ;
379-
380- // Check if the material has a molten fluid
381- Fluid molten = material .getFluid (GCYMFluidStorageKeys .MOLTEN );
382- if (molten == null ) return ;
383-
384- // Get the vacuum freezer EUt and duration
385- BlastProperty property = material .getProperty (PropertyKey .BLAST );
386- int vacuumEUt = property .getVacuumEUtOverride () != -1 ? property .getVacuumEUtOverride () : VA [MV ];
387- int vacuumDuration = property .getVacuumDurationOverride () != -1 ? property .getVacuumDurationOverride () :
388- (int ) material .getMass () * 3 ;
389-
390- // Check if the material has a blast temperature above 5000K
391- if (property .getBlastTemperature () >= 5000 ) {
392- if (material .hasFlag (GENERATE_PLATE )) {
393- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
394- .notConsumable (MetaItems .SHAPE_MOLD_PLATE )
395- .fluidInputs (new FluidStack (molten , 144 ))
396- .fluidInputs (Materials .Helium .getFluid (FluidStorageKeys .LIQUID , 500 ))
397- .fluidOutputs (Materials .Helium .getFluid (250 ))
398- .output (plate , material , 1 )
399- .duration (vacuumDuration )
400- .EUt (vacuumEUt )
401- .buildAndRegister ();
402- }
403- if (material .hasFlag (GENERATE_SMALL_GEAR )) {
404- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
405- .notConsumable (MetaItems .SHAPE_MOLD_GEAR_SMALL )
406- .fluidInputs (new FluidStack (molten , 144 ))
407- .fluidInputs (Materials .Helium .getFluid (FluidStorageKeys .LIQUID , 500 ))
408- .fluidOutputs (Materials .Helium .getFluid (250 ))
409- .output (gearSmall , material , 1 )
410- .duration (vacuumDuration )
411- .EUt (vacuumEUt )
412- .buildAndRegister ();
413- }
414- if (material .hasFlag (GENERATE_GEAR )) {
415- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
416- .notConsumable (MetaItems .SHAPE_MOLD_GEAR )
417- .fluidInputs (new FluidStack (molten , 576 ))
418- .fluidInputs (Materials .Helium .getFluid (FluidStorageKeys .LIQUID , 2000 ))
419- .fluidOutputs (Materials .Helium .getFluid (1000 ))
420- .output (gear , material , 1 )
421- .duration (vacuumDuration * 4 )
422- .EUt (vacuumEUt )
423- .buildAndRegister ();
424- }
425- if (material .hasFlag (GENERATE_ROTOR )) {
426- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
427- .notConsumable (MetaItems .SHAPE_MOLD_ROTOR )
428- .fluidInputs (new FluidStack (molten , 576 ))
429- .fluidInputs (Materials .Helium .getFluid (FluidStorageKeys .LIQUID , 2000 ))
430- .fluidOutputs (Materials .Helium .getFluid (1000 ))
431- .output (rotor , material , 1 )
432- .duration (vacuumDuration * 4 )
433- .EUt (vacuumEUt )
434- .buildAndRegister ();
435- }
436- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
437- .circuitMeta (1 )
438- .fluidInputs (new FluidStack (molten , 144 ))
439- .fluidInputs (Materials .Helium .getFluid (FluidStorageKeys .LIQUID , 500 ))
440- .fluidOutputs (Materials .Helium .getFluid (250 ))
441- .fluidOutputs (material .getFluid (144 ))
442- .duration (vacuumDuration )
443- .EUt (vacuumEUt )
444- .buildAndRegister ();
445- } else {
446- if (material .hasFlag (GENERATE_PLATE )) {
447- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
448- .notConsumable (MetaItems .SHAPE_MOLD_PLATE )
449- .fluidInputs (new FluidStack (molten , 144 ))
450- .output (plate , material , 1 )
451- .duration (vacuumDuration )
452- .EUt (vacuumEUt )
453- .buildAndRegister ();
454- }
455- if (material .hasFlag (GENERATE_SMALL_GEAR )) {
456- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
457- .notConsumable (MetaItems .SHAPE_MOLD_GEAR_SMALL )
458- .fluidInputs (new FluidStack (molten , 144 ))
459- .output (gearSmall , material , 1 )
460- .duration (vacuumDuration )
461- .EUt (vacuumEUt )
462- .buildAndRegister ();
463- }
464- if (material .hasFlag (GENERATE_GEAR )) {
465- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
466- .notConsumable (MetaItems .SHAPE_MOLD_GEAR )
467- .fluidInputs (new FluidStack (molten , 576 ))
468- .output (gear , material , 1 )
469- .duration (vacuumDuration * 4 )
470- .EUt (vacuumEUt )
471- .buildAndRegister ();
472- }
473- if (material .hasFlag (GENERATE_ROTOR )) {
474- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
475- .notConsumable (MetaItems .SHAPE_MOLD_ROTOR )
476- .fluidInputs (new FluidStack (molten , 576 ))
477- .output (rotor , material , 1 )
478- .duration (vacuumDuration * 4 )
479- .EUt (vacuumEUt )
480- .buildAndRegister ();
481- }
482- RecipeMaps .VACUUM_RECIPES .recipeBuilder ()
483- .circuitMeta (1 )
484- .fluidInputs (new FluidStack (molten , 144 ))
485- .fluidOutputs (material .getFluid (144 ))
486- .duration (vacuumDuration )
487- .EUt (vacuumEUt )
488- .buildAndRegister ();
489- }
490- }
491-
492- /**
493- * Remove gem recipes
494- *
495- * @param material The material
496- */
497- private static void removeGem (Material material ) {
498- if (!material .hasProperty (PropertyKey .FLUID )) return ;
499- if (!material .hasProperty (PropertyKey .GEM )) return ;
500- if (!ConfigHolder .recipes .disableManualCompression ) return ;
501-
502- long materialAmount = OrePrefix .block .getMaterialAmount (material );
503- GTRecipeHandler .removeRecipesByInputs (RecipeMaps .FLUID_SOLIDFICATION_RECIPES ,
504- new ItemStack [] { MetaItems .SHAPE_MOLD_BLOCK .getStackForm () },
505- new FluidStack [] {
506- material .getProperty (PropertyKey .FLUID ).solidifiesFrom (((int ) (materialAmount * L / M ))) });
507- }
508364}
0 commit comments