Skip to content

Commit

Permalink
Add and tweak various Recipe Categories (#2346)
Browse files Browse the repository at this point in the history
  • Loading branch information
YoungOnionMC authored Nov 15, 2024
1 parent f43b6c3 commit aaea9ab
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 34 deletions.
5 changes: 5 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -3860,8 +3860,13 @@
"gtceu.pyrolyse_oven": "uǝʌO ǝsʎןoɹʎԀ",
"gtceu.recipe.amperage": "%s :ǝbɐɹǝdɯⱯ",
"gtceu.recipe.category.arc_furnace_recycling": "buıddɐɹɔS ɐɯsɐןԀ",
"gtceu.recipe.category.chem_dyes": "buıǝʎᗡ ןɐɔıɯǝɥƆ",
"gtceu.recipe.category.extractor_recycling": "buıʇןǝɯǝᴚ dɐɹɔS",
"gtceu.recipe.category.ingot_molding": "buıpןoW ןɐʇǝW",
"gtceu.recipe.category.macerator_recycling": "buıpuıɹ⅁ ʇɹɐԀ",
"gtceu.recipe.category.ore_bathing": "buıʇɐǝɹ⟘ ǝɹO",
"gtceu.recipe.category.ore_crushing": "buıpuıɹ⅁ ǝɹO",
"gtceu.recipe.category.ore_forging": "buıɥsnɹƆ ǝɹO",
"gtceu.recipe.chance": "ɹǝıʇ/%s+ %s :ǝɔuɐɥƆ",
"gtceu.recipe.cleanroom": "%s sǝɹınbǝᴚ",
"gtceu.recipe.cleanroom.display_name": "ɯooɹuɐǝןƆ",
Expand Down
5 changes: 5 additions & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -3860,8 +3860,13 @@
"gtceu.pyrolyse_oven": "Pyrolyse Oven",
"gtceu.recipe.amperage": "Amperage: %s",
"gtceu.recipe.category.arc_furnace_recycling": "Plasma Scrapping",
"gtceu.recipe.category.chem_dyes": "Chemical Dyeing",
"gtceu.recipe.category.extractor_recycling": "Scrap Remelting",
"gtceu.recipe.category.ingot_molding": "Metal Molding",
"gtceu.recipe.category.macerator_recycling": "Part Grinding",
"gtceu.recipe.category.ore_bathing": "Ore Treating",
"gtceu.recipe.category.ore_crushing": "Ore Grinding",
"gtceu.recipe.category.ore_forging": "Ore Crushing",
"gtceu.recipe.chance": "Chance: %s +%s/tier",
"gtceu.recipe.cleanroom": "Requires %s",
"gtceu.recipe.cleanroom.display_name": "Cleanroom",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ public class GTRecipeCategories {
.of(GTCEu.MOD_ID, "extractor_recycling", GTRecipeTypes.EXTRACTOR_RECIPES)
.setIcon(GuiTextures.EXTRACTOR_RECYCLING_CATEGORY);

public static final GTRecipeCategory ORE_CRUSHING = GTRecipeCategory
.of(GTCEu.MOD_ID, "ore_crushing", GTRecipeTypes.MACERATOR_RECIPES);

public static final GTRecipeCategory ORE_FORGING = GTRecipeCategory
.of(GTCEu.MOD_ID, "ore_forging", GTRecipeTypes.FORGE_HAMMER_RECIPES);

public static final GTRecipeCategory ORE_BATHING = GTRecipeCategory
.of(GTCEu.MOD_ID, "ore_bathing", GTRecipeTypes.CHEMICAL_BATH_RECIPES);

public static final GTRecipeCategory CHEM_DYES = GTRecipeCategory
.of(GTCEu.MOD_ID, "chem_dyes", GTRecipeTypes.CHEMICAL_BATH_RECIPES);

public static final GTRecipeCategory INGOT_MOLDING = GTRecipeCategory
.of(GTCEu.MOD_ID, "ingot_molding", GTRecipeTypes.ALLOY_SMELTER_RECIPES);

public static void init() {
GTRegistries.RECIPE_CATEGORIES.remove(DUMMY.getResourceLocation());
ModLoader.get().postEvent(new GTCEuAPI.RegisterEvent<>(GTRegistries.RECIPE_CATEGORIES, GTRecipeCategory.class));
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/data/lang/ItemLang.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ private static void initGeneratedNames(RegistrateLangProvider provider) {
provider.add("gtceu.recipe.category.arc_furnace_recycling", "Plasma Scrapping");
provider.add("gtceu.recipe.category.macerator_recycling", "Part Grinding");
provider.add("gtceu.recipe.category.extractor_recycling", "Scrap Remelting");
provider.add("gtceu.recipe.category.ore_crushing", "Ore Grinding");
provider.add("gtceu.recipe.category.ore_forging", "Ore Crushing");
provider.add("gtceu.recipe.category.ore_bathing", "Ore Treating");
provider.add("gtceu.recipe.category.chem_dyes", "Chemical Dyeing");
provider.add("gtceu.recipe.category.ingot_molding", "Metal Molding");

// TagPrefix
for (TagPrefix tagPrefix : TagPrefix.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public GTRecipeBuilder copy(ResourceLocation id) {
copy.chance = this.chance;
copy.perTick = this.perTick;
copy.isFuel = this.isFuel;
copy.recipeCategory = this.recipeCategory;
copy.uiName = this.uiName;
copy.slotName = this.slotName;
copy.onSave = this.onSave;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTItems;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.common.data.GTRecipeCategories;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.CraftingComponent;
import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper;
Expand Down Expand Up @@ -336,6 +337,7 @@ public static void processIngot(TagPrefix ingotPrefix, Material material, IngotP
.inputItems(ingot, material)
.notConsumable(GTItems.SHAPE_MOLD_NUGGET)
.outputItems(nugget, material, 9)
.category(GTRecipeCategories.INGOT_MOLDING)
.save(provider);

if (!ChemicalHelper.get(block, material).isEmpty()) {
Expand All @@ -344,6 +346,7 @@ public static void processIngot(TagPrefix ingotPrefix, Material material, IngotP
.inputItems(block, material)
.notConsumable(GTItems.SHAPE_MOLD_INGOT)
.outputItems(ingot, material, (int) (block.getMaterialAmount(material) / M))
.category(GTRecipeCategories.INGOT_MOLDING)
.save(provider);

COMPRESSOR_RECIPES.recipeBuilder("compress_" + material.getName() + "_to_block")
Expand Down Expand Up @@ -472,6 +475,7 @@ public static void processNugget(TagPrefix orePrefix, Material material, DustPro
.inputItems(nugget, material, 9)
.notConsumable(GTItems.SHAPE_MOLD_INGOT)
.outputItems(ingot, material)
.category(GTRecipeCategories.INGOT_MOLDING)
.save(provider);

if (material.hasFluid()) {
Expand Down Expand Up @@ -588,6 +592,7 @@ public static void processBlock(TagPrefix blockPrefix, Material material, DustPr
.notConsumable(GTItems.SHAPE_MOLD_BLOCK)
.outputItems(blockStack)
.duration(5).EUt(4L * voltageMultiplier)
.category(GTRecipeCategories.INGOT_MOLDING)
.save(provider);
} else if (material.hasProperty(PropertyKey.GEM)) {
COMPRESSOR_RECIPES.recipeBuilder("compress_" + material.getName() + "_gem_to_block")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.gregtechceu.gtceu.api.data.chemical.material.stack.UnificationEntry;
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.common.data.GTRecipeCategories;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper;
import com.gregtechceu.gtceu.data.recipe.builder.GTRecipeBuilder;
Expand Down Expand Up @@ -77,6 +78,7 @@ public static void processOreForgeHammer(TagPrefix orePrefix, Material material,
GTRecipeBuilder builder = FORGE_HAMMER_RECIPES
.recipeBuilder("hammer_" + prefixString + material.getName() + "_ore_to_raw_ore")
.inputItems(orePrefix, material)
.category(GTRecipeCategories.ORE_FORGING)
.duration(10).EUt(16);
if (material.hasProperty(PropertyKey.GEM) && !gem.isIgnored(material)) {
builder.outputItems(GTUtil.copyAmount(amountOfCrushedOre * oreTypeMultiplier,
Expand Down Expand Up @@ -117,6 +119,7 @@ public static void processOre(TagPrefix orePrefix, Material material, OrePropert
.outputItems(GTUtil.copyAmount(amountOfCrushedOre * 2 * oreTypeMultiplier, crushedStack))
.chancedOutput(byproductStack, 1400, 850)
.EUt(2)
.category(GTRecipeCategories.ORE_CRUSHING)
.duration(400);

for (MaterialStack secondaryMaterial : orePrefix.secondaryMaterials()) {
Expand Down Expand Up @@ -167,6 +170,7 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp
GTRecipeBuilder builder = FORGE_HAMMER_RECIPES
.recipeBuilder("hammer_" + orePrefix.name + "_" + material.getName() + "_to_crushed_ore")
.inputItems(orePrefix, material)
.category(GTRecipeCategories.ORE_FORGING)
.duration(10).EUt(16);
if (material.hasProperty(PropertyKey.GEM) && !gem.isIgnored(material)) {
builder.outputItems(ChemicalHelper.get(gem, material, crushedStack.getCount()));
Expand All @@ -179,6 +183,7 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp
.recipeBuilder("macerate_" + orePrefix.name + "_" + material.getName() + "_ore_to_crushed_ore")
.inputItems(orePrefix, material)
.outputItems(GTUtil.copyAmount(crushedStack.getCount() * 2, crushedStack))
.category(GTRecipeCategories.ORE_CRUSHING)
.EUt(2)
.duration(400);

Expand Down Expand Up @@ -231,6 +236,7 @@ public static void processRawOre(TagPrefix orePrefix, Material material, OreProp
FORGE_HAMMER_RECIPES.recipeBuilder("decompress_" + material.getName() + "_to_raw_ore")
.inputItems(rawOreBlock, material)
.outputItems(rawOre, material, 9)
.category(GTRecipeCategories.ORE_FORGING)
.duration(300).EUt(2).save(provider);
}

Expand All @@ -243,6 +249,7 @@ public static void processCrushedOre(TagPrefix crushedPrefix, Material material,
.inputItems(crushedPrefix, material)
.outputItems(impureDustStack)
.duration(10).EUt(16)
.category(GTRecipeCategories.ORE_FORGING)
.save(provider);

MACERATOR_RECIPES.recipeBuilder("macerate_" + material.getName() + "_crushed_ore_to_impure_dust")
Expand All @@ -251,6 +258,7 @@ public static void processCrushedOre(TagPrefix crushedPrefix, Material material,
.duration(400).EUt(2)
.chancedOutput(ChemicalHelper.get(dust, byproductMaterial, property.getByProductMultiplier()), 1400,
850)
.category(GTRecipeCategories.ORE_CRUSHING)
.save(provider);

ItemStack crushedPurifiedOre = GTUtil.copy(
Expand Down Expand Up @@ -305,6 +313,7 @@ public static void processCrushedOre(TagPrefix crushedPrefix, Material material,
580)
.chancedOutput(ChemicalHelper.get(dust, Stone), 4000, 650)
.duration(200).EUt(VA[LV])
.category(GTRecipeCategories.ORE_BATHING)
.save(provider);
}

Expand All @@ -324,13 +333,15 @@ public static void processCrushedCentrifuged(TagPrefix centrifugedPrefix, Materi
.inputItems(centrifugedPrefix, material)
.outputItems(dustStack)
.duration(10).EUt(16)
.category(GTRecipeCategories.ORE_FORGING)
.save(provider);

MACERATOR_RECIPES.recipeBuilder("macerate_" + material.getName() + "_refined_ore_to_dust")
.inputItems(centrifugedPrefix, material)
.outputItems(dustStack)
.chancedOutput(byproductStack, 1400, 850)
.duration(400).EUt(2)
.category(GTRecipeCategories.ORE_CRUSHING)
.save(provider);

VanillaRecipeHelper.addShapelessRecipe(provider,
Expand All @@ -353,13 +364,15 @@ public static void processCrushedPurified(TagPrefix purifiedPrefix, Material mat
.outputItems(dustStack)
.duration(10)
.EUt(16)
.category(GTRecipeCategories.ORE_FORGING)
.save(provider);

MACERATOR_RECIPES.recipeBuilder("macerate_" + material.getName() + "_crushed_ore_to_dust")
.inputItems(purifiedPrefix, material)
.outputItems(dustStack)
.chancedOutput(byproductStack, 1400, 850)
.duration(400).EUt(2)
.category(GTRecipeCategories.ORE_CRUSHING)
.save(provider);

VanillaRecipeHelper.addShapelessRecipe(provider, String.format("purified_ore_to_dust_%s", material.getName()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.gregtechceu.gtceu.api.data.tag.TagPrefix;
import com.gregtechceu.gtceu.common.data.GTItems;
import com.gregtechceu.gtceu.common.data.GTMaterials;
import com.gregtechceu.gtceu.common.data.GTRecipeCategories;
import com.gregtechceu.gtceu.common.item.TurbineRotorBehaviour;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper;
Expand Down Expand Up @@ -185,6 +186,7 @@ public static void processGear(TagPrefix gearPrefix, Material material, DustProp
.outputItems(gearPrefix, material)
.duration((int) material.getMass() * 10)
.EUt(2L * voltageMultiplier)
.category(GTRecipeCategories.INGOT_MOLDING)
.save(provider);

if (material.hasFlag(NO_SMASHING)) {
Expand Down Expand Up @@ -229,6 +231,7 @@ public static void processGear(TagPrefix gearPrefix, Material material, DustProp
.inputItems(ingot, material, 2)
.notConsumable(GTItems.SHAPE_MOLD_GEAR_SMALL)
.outputItems(gearSmall, material)
.category(GTRecipeCategories.INGOT_MOLDING)
.save(provider);

if (material.hasFlag(NO_SMASHING)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.gregtechceu.gtceu.data.recipe.misc;

import com.gregtechceu.gtceu.common.data.GTRecipeCategories;

import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.world.item.DyeColor;

Expand Down Expand Up @@ -61,20 +63,23 @@ private static void dyeRecipes(Consumer<FinishedRecipe> provider) {
.inputFluids(CHEMICAL_DYES[i].getFluid(9))
.outputItems(METAL_SHEETS.get(color))
.EUt(2).duration(10)
.category(GTRecipeCategories.CHEM_DYES)
.save(provider);

CHEMICAL_BATH_RECIPES.recipeBuilder("large_metal_sheet_%s".formatted(colorName))
.inputItems(LARGE_METAL_SHEETS.get(DyeColor.WHITE).asStack())
.inputFluids(CHEMICAL_DYES[i].getFluid(9))
.outputItems(LARGE_METAL_SHEETS.get(color))
.EUt(2).duration(10)
.category(GTRecipeCategories.CHEM_DYES)
.save(provider);

CHEMICAL_BATH_RECIPES.recipeBuilder("studs_%s".formatted(colorName))
.inputItems(STUDS.get(DyeColor.BLACK).asStack())
.inputFluids(CHEMICAL_DYES[i].getFluid(9))
.outputItems(STUDS.get(color))
.EUt(2).duration(10)
.category(GTRecipeCategories.CHEM_DYES)
.save(provider);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.gregtechceu.gtceu.api.data.chemical.material.MarkerMaterials.Color;
import com.gregtechceu.gtceu.api.data.chemical.material.stack.UnificationEntry;
import com.gregtechceu.gtceu.common.data.GTBlocks;
import com.gregtechceu.gtceu.common.data.GTRecipeCategories;
import com.gregtechceu.gtceu.config.ConfigHolder;
import com.gregtechceu.gtceu.data.recipe.CustomTags;
import com.gregtechceu.gtceu.data.recipe.VanillaRecipeHelper;
Expand Down Expand Up @@ -401,41 +402,18 @@ public static void init(Consumer<FinishedRecipe> provider) {

// Dyed Lens Recipes
GTRecipeBuilder builder = CHEMICAL_BATH_RECIPES.recipeBuilder("").EUt(VA[HV]).duration(200).inputItems(lens,
Glass);
Glass).category(GTRecipeCategories.CHEM_DYES);
final int dyeAmount = 288;

// skip white lens
for (int i = 1; i < CHEMICAL_DYES.length; i++) {
builder.copy(CHEMICAL_DYES[i].getName() + "_lens").inputFluids(CHEMICAL_DYES[i].getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.VALUES[i]))
.save(provider);
}

builder.copy("colorless_lens").inputFluids(DyeWhite.getFluid(dyeAmount)).outputItems(lens, Glass)
.save(provider);
builder.copy("orange_lens").inputFluids(DyeOrange.getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.Orange)).save(provider);
builder.copy("magenta_lens").inputFluids(DyeMagenta.getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.Magenta)).save(provider);
builder.copy("light_blue_lens").inputFluids(DyeLightBlue.getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.LightBlue)).save(provider);
builder.copy("yellow_lens").inputFluids(DyeYellow.getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.Yellow)).save(provider);
builder.copy("lime_lens").inputFluids(DyeLime.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Lime))
.save(provider);
builder.copy("pink_lens").inputFluids(DyePink.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Pink))
.save(provider);
builder.copy("gray_lens").inputFluids(DyeGray.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Gray))
.save(provider);
builder.copy("light_gray_lens").inputFluids(DyeLightGray.getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.LightGray)).save(provider);
builder.copy("cyan_lens").inputFluids(DyeCyan.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Cyan))
.save(provider);
builder.copy("purple_lens").inputFluids(DyePurple.getFluid(dyeAmount))
.outputItems(GLASS_LENSES.get(Color.Purple)).save(provider);
builder.copy("blue_lens").inputFluids(DyeBlue.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Blue))
.save(provider);
builder.copy("brown_lens").inputFluids(DyeBrown.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Brown))
.save(provider);
builder.copy("green_lens").inputFluids(DyeGreen.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Green))
.save(provider);
builder.copy("red_lens").inputFluids(DyeRed.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Red))
.save(provider);
builder.copy("black_lens").inputFluids(DyeBlack.getFluid(dyeAmount)).outputItems(GLASS_LENSES.get(Color.Black))
.save(provider);

// NAN Certificate
EXTRUDER_RECIPES.recipeBuilder("nan_certificate")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,23 @@ private static void registerMaceratorRecycling(Consumer<FinishedRecipe> provider
GTRecipeBuilder builder = GTRecipeTypes.MACERATOR_RECIPES.recipeBuilder("macerate_" + itemPath.getPath())
.outputItems(outputs.toArray(ItemStack[]::new))
.duration(calculateDuration(outputs))
.EUt(2L * multiplier)
.category(GTRecipeCategories.MACERATOR_RECYCLING);
.EUt(2L * multiplier);

if (inputTag == null) {
builder.inputItems(input.copy());
} else {
builder.inputItems(inputTag);
}

boolean recycle = true;
if (entry != null && entry.tagPrefix == TagPrefix.ingot) {
recycle = false;
}

if (recycle) {
builder.category(GTRecipeCategories.MACERATOR_RECYCLING);
}

builder.save(provider);
}

Expand Down Expand Up @@ -305,7 +315,7 @@ private static boolean needsRecyclingCategory(@Nullable TagPrefix prefix, @Nulla
UnificationEntry entry = ChemicalHelper.getUnificationEntry(outputs.get(0).getItem());
if (entry != null && inputStack != null) {
Material mat = inputStack.material();
if (mat.hasFlag(IS_MAGNETIC) && mat.hasProperty(PropertyKey.INGOT)) {
if (!mat.hasFlag(IS_MAGNETIC) && mat.hasProperty(PropertyKey.INGOT)) {
return mat.getProperty(PropertyKey.INGOT).getArcSmeltingInto() != entry.material;
}
}
Expand Down
Loading

0 comments on commit aaea9ab

Please sign in to comment.