Skip to content

Commit

Permalink
If tin is detected, alloy pewter from that (#5033)
Browse files Browse the repository at this point in the history
I expected this to happen one day, a mod popping up that makes pewter using tin
  • Loading branch information
KnightMiner committed Dec 26, 2022
1 parent c0a2061 commit f23cf76
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"type": "tconstruct:alloy",
"type": "forge:conditional",
"conditions": [
{
"value": {
Expand All @@ -16,19 +16,60 @@
"type": "forge:not"
}
],
"inputs": [
"recipes": [
{
"tag": "forge:molten_iron",
"amount": 90
"conditions": [
{
"value": {
"tag": "forge:ingots/tin",
"type": "forge:tag_empty"
},
"type": "forge:not"
}
],
"recipe": {
"type": "tconstruct:alloy",
"inputs": [
{
"tag": "forge:molten_tin",
"amount": 180
},
{
"tag": "forge:molten_lead",
"amount": 90
}
],
"result": {
"fluid": "tconstruct:molten_pewter",
"amount": 270
},
"temperature": 400
}
},
{
"tag": "forge:molten_lead",
"amount": 90
"conditions": [
{
"type": "forge:true"
}
],
"recipe": {
"type": "tconstruct:alloy",
"inputs": [
{
"tag": "forge:molten_iron",
"amount": 90
},
{
"tag": "forge:molten_lead",
"amount": 90
}
],
"result": {
"fluid": "tconstruct:molten_pewter",
"amount": 180
},
"temperature": 400
}
}
],
"result": {
"fluid": "tconstruct:molten_pewter",
"amount": 180
},
"temperature": 400
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1678,10 +1678,22 @@ private void addAlloyRecipes(Consumer<FinishedRecipe> consumer) {

// pewter
wrapped = withCondition(consumer, tagCondition("ingots/pewter"), tagCondition("ingots/lead"));
AlloyRecipeBuilder.alloy(TinkerFluids.moltenPewter.get(), FluidValues.INGOT * 2)
.addInput(TinkerFluids.moltenIron.getForgeTag(), FluidValues.INGOT)
.addInput(TinkerFluids.moltenLead.getForgeTag(), FluidValues.INGOT)
.save(wrapped, prefix(TinkerFluids.moltenPewter, folder));
ConditionalRecipe.builder()
// when available, alloy pewter with tin
// we mainly add it to support Edilon which uses iron to reduce ores, but the author thinks tin is fine balance wise
.addCondition(tagCondition("ingots/tin"))
.addRecipe(
// ratio from Allomancy mod
AlloyRecipeBuilder.alloy(TinkerFluids.moltenPewter.get(), FluidValues.INGOT * 3)
.addInput(TinkerFluids.moltenTin.getForgeTag(), FluidValues.INGOT * 2)
.addInput(TinkerFluids.moltenLead.getForgeTag(), FluidValues.INGOT)::save)
.addCondition(TrueCondition.INSTANCE) // fallback
.addRecipe(
// ratio from Edilon mod
AlloyRecipeBuilder.alloy(TinkerFluids.moltenPewter.get(), FluidValues.INGOT * 2)
.addInput(TinkerFluids.moltenIron.getForgeTag(), FluidValues.INGOT)
.addInput(TinkerFluids.moltenLead.getForgeTag(), FluidValues.INGOT)::save)
.build(wrapped, prefix(TinkerFluids.moltenPewter, folder));

// thermal alloys
Function<String,ICondition> fluidTagLoaded = name -> new NotCondition(new TagEmptyCondition<>(Registry.FLUID_REGISTRY, new ResourceLocation("forge", name)));
Expand Down

0 comments on commit f23cf76

Please sign in to comment.