Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingredient suggestions 1 #8174

Merged
merged 6 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ private void addAdvancements() {
add(MekanismAdvancements.STEEL_INGOT, "Industrial Revolution", "Infuse Iron with Carbon and repeat");
add(MekanismAdvancements.STEEL_CASING, "The Perfect Foundation", "Used in even the most advanced machines");

add(MekanismAdvancements.INFUSED_ALLOY, "The Alloy That Started it All", "Infuse Iron with Redstone");
add(MekanismAdvancements.INFUSED_ALLOY, "The Alloy That Started it All", "Infuse Copper with Redstone");
add(MekanismAdvancements.REINFORCED_ALLOY, "Make it Stronger", "Diamonds make everything better!");
add(MekanismAdvancements.ATOMIC_ALLOY, "Top Tier Alloy", "Create one of the strongest alloys in existence");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package mekanism.common.recipe.impl;

import mekanism.api.MekanismAPITags;
import mekanism.api.chemical.Chemical;
import mekanism.api.datagen.recipe.builder.ItemStackChemicalToItemStackRecipeBuilder;
import mekanism.api.providers.IItemProvider;
import mekanism.api.recipes.ingredients.creator.IngredientCreatorAccess;
Expand Down Expand Up @@ -35,6 +36,11 @@ public void addRecipes(RecipeOutput consumer, HolderLookup.Provider registries)
addCircuitUpgradeRecipe(consumer, MekanismItems.ADVANCED_CONTROL_CIRCUIT, MekanismTags.Items.CIRCUITS_BASIC, MekanismTags.Items.ALLOYS_INFUSED, basePath, "advanced");
addCircuitUpgradeRecipe(consumer, MekanismItems.ELITE_CONTROL_CIRCUIT, MekanismTags.Items.CIRCUITS_ADVANCED, MekanismTags.Items.ALLOYS_REINFORCED, basePath, "elite");
addCircuitUpgradeRecipe(consumer, MekanismItems.ULTIMATE_CONTROL_CIRCUIT, MekanismTags.Items.CIRCUITS_ELITE, MekanismTags.Items.ALLOYS_ATOMIC, basePath, "ultimate");

//infusion variants that save on the base ingots needed, but take extra infusion material
addCircuitInfusionUpgrade(consumer, MekanismItems.ADVANCED_CONTROL_CIRCUIT, MekanismTags.Items.CIRCUITS_BASIC, MekanismAPITags.Chemicals.REDSTONE, 10, basePath, "advanced");
addCircuitInfusionUpgrade(consumer, MekanismItems.ELITE_CONTROL_CIRCUIT, MekanismTags.Items.CIRCUITS_ADVANCED, MekanismAPITags.Chemicals.DIAMOND, 20, basePath, "elite");
addCircuitInfusionUpgrade(consumer, MekanismItems.ULTIMATE_CONTROL_CIRCUIT, MekanismTags.Items.CIRCUITS_ELITE, MekanismAPITags.Chemicals.REFINED_OBSIDIAN, 40, basePath, "ultimate");
}

private void addCircuitUpgradeRecipe(RecipeOutput consumer, IItemProvider output, TagKey<Item> circuitTag, TagKey<Item> alloyTag, String basePath,
Expand All @@ -45,4 +51,13 @@ private void addCircuitUpgradeRecipe(RecipeOutput consumer, IItemProvider output
.key(Pattern.ALLOY, alloyTag)
.build(consumer, Mekanism.rl(basePath + name));
}

private void addCircuitInfusionUpgrade(RecipeOutput consumer, IItemProvider output, TagKey<Item> circuitTag, TagKey<Chemical> infusionType, int singleAlloyAmount, String basePath, String name) {
ItemStackChemicalToItemStackRecipeBuilder.metallurgicInfusing(
IngredientCreatorAccess.item().from(circuitTag),
IngredientCreatorAccess.chemicalStack().from(infusionType, singleAlloyAmount * 6), /* 3x 2 alloys */
output.getItemStack(),
false
).build(consumer, Mekanism.rl(basePath + "infused_" + name));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void addRecipes(RecipeOutput consumer, HolderLookup.Provider registries)
private void addMetallurgicInfuserAlloyRecipes(RecipeOutput consumer, String basePath) {
//Infused
ItemStackChemicalToItemStackRecipeBuilder.metallurgicInfusing(
IngredientCreatorAccess.item().from(Tags.Items.INGOTS_IRON),
IngredientCreatorAccess.item().from(Tags.Items.INGOTS_COPPER),
IngredientCreatorAccess.chemicalStack().from(MekanismAPITags.Chemicals.REDSTONE, 10),
MekanismItems.INFUSED_ALLOY.getItemStack(),
false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ public void addRecipes(RecipeOutput consumer, HolderLookup.Provider registries)
MekanismItems.ENRICHED_IRON.getItemStack(),
false
).build(consumer, Mekanism.rl(basePath + "iron/enriched"));
ItemStackChemicalToItemStackRecipeBuilder.metallurgicInfusing(
IngredientCreatorAccess.item().from(MekanismTags.Items.PROCESSED_RESOURCES.get(ResourceType.DUST, PrimaryResource.IRON)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to add a second recipe like this, or just make the first recipe use an an or (compound) ingredient? I am fine with either. If you do decide to use an or ingredient you can use one of our helpers: BaseRecipeProvider.createIngredient, which you can see how we do it in how we add the recipes that create carbon.

I sort of think it makes more sense for it to just be a single recipe. But I am leaving that up to you.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can merge it later if we remember. Separate for now would promote visibility?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, though I don't think the visibility is that bad given the fact there is basically only ever one iron ingot in modded playthroughs, and then it just cycles between the two inputs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am going to merge them for now. Visibility doesn't seem that bad to me for the above stated reason

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually scratch that, I didn't think about the fact that whil ethere is only one iron ingot, there are often multiple iron dusts.

IngredientCreatorAccess.chemicalStack().from(MekanismAPITags.Chemicals.CARBON, 10),
MekanismItems.ENRICHED_IRON.getItemStack(),
false
).build(consumer, Mekanism.rl(basePath + "iron/enriched_dust"));
addNetheriteProcessingRecipes(consumer, basePath + "netherite/");
addBronzeProcessingRecipes(consumer, basePath + "bronze/");
addCoalOreProcessingRecipes(consumer, basePath + "coal/");
Expand Down