mirror of
https://github.com/minetest-mods/technic.git
synced 2025-07-01 15:50:39 +02:00
split default iron/steel into three metals
Override the default mod's iron/steel substance, replacing it with three metals: wrought iron (pure iron), carbon steel (iron alloyed with a little carbon), and cast iron (iron alloyed with lots of carbon). Wrought iron is easiest to refine, then cast iron, and carbon steel the most difficult, matching the historical progression. Recipes that used default steel are changed to use one of the three, the choice of alloy for each application being both somewhat realistic and also matching up with game progression. The default:steel{_ingot,block} items are identified specifically with wrought iron. This makes the default refining recipes work appropriately. Iron-using recipes defined outside technic are thus necessarily reinterpreted to use wrought iron, which is mostly appropriate. Some objects are renamed accordingly. Rather than use the default steel textures for wrought iron, with technic providing textures for the other two, technic now provides textures for all three metals. This avoids problems that would occur with texture packs that provide default_steel_{ingot,block} textures that are not intended to support this wrought-iron/carbon-steel/cast-iron distinction. A texture pack can provide a distinct set of three textures specifically for the situation where this distinction is required. Incidentally make grinding and alloy cooking recipes work correctly when ingredients are specified by alias.
This commit is contained in:
@ -3,9 +3,9 @@ local S = technic.getter
|
||||
|
||||
minetest.register_craft({
|
||||
recipe = {
|
||||
{"default:steelblock", "pipeworks:filter", "default:steelblock"},
|
||||
{"default:steelblock", "technic:motor", "default:steelblock"},
|
||||
{"default:steelblock", "technic:diamond_drill_head", "default:steelblock"}},
|
||||
{"technic:carbon_steel_block", "pipeworks:filter", "technic:carbon_steel_block"},
|
||||
{"technic:carbon_steel_block", "technic:motor", "technic:carbon_steel_block"},
|
||||
{"technic:carbon_steel_block", "technic:diamond_drill_head", "technic:carbon_steel_block"}},
|
||||
output = "technic:quarry",
|
||||
})
|
||||
|
||||
@ -136,9 +136,9 @@ end
|
||||
|
||||
minetest.register_node("technic:quarry", {
|
||||
description = S("Quarry"),
|
||||
tiles = {"default_steel_block.png", "default_steel_block.png",
|
||||
"default_steel_block.png", "default_steel_block.png",
|
||||
"default_steel_block.png^default_tool_mesepick.png", "default_steel_block.png"},
|
||||
tiles = {"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png", "technic_carbon_steel_block.png",
|
||||
"technic_carbon_steel_block.png^default_tool_mesepick.png", "technic_carbon_steel_block.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=2, tubedevice=1},
|
||||
tube = {
|
||||
|
@ -4,9 +4,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_array_hv 1',
|
||||
recipe = {
|
||||
{'technic:solar_array_mv', 'technic:solar_array_mv', 'technic:solar_array_mv'},
|
||||
{'default:steel_ingot', 'technic:hv_transformer', 'default:steel_ingot'},
|
||||
{'', 'technic:hv_cable0', ''},
|
||||
{'technic:solar_array_mv', 'technic:solar_array_mv', 'technic:solar_array_mv'},
|
||||
{'technic:carbon_steel_ingot', 'technic:hv_transformer', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:hv_cable0', ''},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -4,9 +4,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_alloy_furnace',
|
||||
recipe = {
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', '', 'default:brick'},
|
||||
{'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
|
||||
{'default:brick', 'default:brick', 'default:brick'},
|
||||
{'default:brick', '', 'default:brick'},
|
||||
{'technic:cast_iron_ingot', 'default:copper_ingot', 'technic:cast_iron_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:lv_battery_box0',
|
||||
recipe = {
|
||||
{'technic:battery', 'group:wood', 'technic:battery'},
|
||||
{'technic:battery', 'default:copper_ingot', 'technic:battery'},
|
||||
{'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'},
|
||||
{'technic:battery', 'group:wood', 'technic:battery'},
|
||||
{'technic:battery', 'default:copper_ingot', 'technic:battery'},
|
||||
{'technic:cast_iron_ingot', 'technic:cast_iron_ingot', 'technic:cast_iron_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -229,8 +229,8 @@ minetest.register_craft({
|
||||
output = 'technic:cnc',
|
||||
recipe = {
|
||||
{'default:glass', 'technic:diamond_drill_head', 'default:glass'},
|
||||
{'technic:control_logic_unit', 'technic:motor', 'default:steel_ingot'},
|
||||
{'default:steel_ingot', 'default:copper_ingot', 'default:steel_ingot'},
|
||||
{'technic:control_logic_unit', 'technic:motor', 'technic:carbon_steel_ingot'},
|
||||
{'technic:carbon_steel_ingot', 'default:copper_ingot', 'technic:carbon_steel_ingot'},
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -58,12 +58,13 @@ technic.cnc.register_all("default:tree",
|
||||
{snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=3, wood=1, not_in_creative_inventory=1},
|
||||
{"default_tree.png"},
|
||||
S("Tree"))
|
||||
-- STEEL
|
||||
--------
|
||||
|
||||
-- WROUGHT IRON
|
||||
---------------
|
||||
technic.cnc.register_all("default:steelblock",
|
||||
{cracky=1, level=2, not_in_creative_inventory=1},
|
||||
{"default_steel_block.png"},
|
||||
S("Steel"))
|
||||
{"technic_wrought_iron_block.png"},
|
||||
S("Wrought Iron"))
|
||||
|
||||
-- Bronze
|
||||
--------
|
||||
|
@ -5,9 +5,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:electric_furnace',
|
||||
recipe = {
|
||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
||||
{'default:cobble', '', 'default:cobble'},
|
||||
{'default:steel_ingot', 'moreores:copper_ingot', 'default:steel_ingot'},
|
||||
{'default:cobble', 'default:cobble', 'default:cobble'},
|
||||
{'default:cobble', '', 'default:cobble'},
|
||||
{'technic:cast_iron_ingot', 'moreores:copper_ingot', 'technic:cast_iron_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -8,9 +8,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_array_lv 1',
|
||||
recipe = {
|
||||
{'technic:solar_panel', 'technic:solar_panel', 'technic:solar_panel'},
|
||||
{'default:steel_ingot', 'technic:lv_transformer', 'default:steel_ingot'},
|
||||
{'', 'technic:lv_cable0', ''},
|
||||
{'technic:solar_panel', 'technic:solar_panel', 'technic:solar_panel'},
|
||||
{'technic:carbon_steel_ingot', 'technic:lv_transformer', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:lv_cable0', ''},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -29,7 +29,7 @@ minetest.register_craft({
|
||||
output = 'technic:solar_panel',
|
||||
recipe = {
|
||||
{'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer', 'technic:doped_silicon_wafer'},
|
||||
{'default:steel_ingot', 'technic:lv_cable0', 'default:steel_ingot'},
|
||||
{'technic:wrought_iron_ingot', 'technic:lv_cable0', 'technic:wrought_iron_ingot'},
|
||||
|
||||
}
|
||||
})
|
||||
|
@ -2,9 +2,9 @@
|
||||
minetest.register_craft({
|
||||
output = 'technic:solar_array_mv 1',
|
||||
recipe = {
|
||||
{'technic:solar_array_lv', 'technic:solar_array_lv', 'technic:solar_array_lv'},
|
||||
{'default:steel_ingot', 'technic:mv_transformer', 'default:steel_ingot'},
|
||||
{'', 'technic:mv_cable0', ''},
|
||||
{'technic:solar_array_lv', 'technic:solar_array_lv', 'technic:solar_array_lv'},
|
||||
{'technic:carbon_steel_ingot', 'technic:mv_transformer', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:mv_cable0', ''},
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -4,25 +4,25 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = 'technic:wind_mill_frame 5',
|
||||
recipe = {
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'default:steel_ingot', '', 'default:steel_ingot'},
|
||||
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:carbon_steel_ingot', ''},
|
||||
{'technic:carbon_steel_ingot', '', 'technic:carbon_steel_ingot'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'technic:wind_mill',
|
||||
recipe = {
|
||||
{'', 'default:steel_ingot', ''},
|
||||
{'default:steel_ingot', 'technic:motor', 'default:steel_ingot'},
|
||||
{'', 'default:steelblock', ''},
|
||||
{'', 'technic:carbon_steel_ingot', ''},
|
||||
{'technic:carbon_steel_ingot', 'technic:motor', 'technic:carbon_steel_ingot'},
|
||||
{'', 'technic:carbon_steel_block', ''},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("technic:wind_mill_frame", {
|
||||
description = S("Wind Mill Frame"),
|
||||
drawtype = "glasslike_framed",
|
||||
tiles = {"default_steel_block.png", "default_glass.png"},
|
||||
tiles = {"technic_carbon_steel_block.png", "default_glass.png"},
|
||||
sunlight_propagates = true,
|
||||
groups = {cracky=3},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
@ -31,7 +31,7 @@ minetest.register_node("technic:wind_mill_frame", {
|
||||
|
||||
minetest.register_node("technic:wind_mill", {
|
||||
description = S("Wind Mill"),
|
||||
tiles = {"default_steel_block.png"},
|
||||
tiles = {"technic_carbon_steel_block.png"},
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
|
@ -45,6 +45,36 @@ technic.register_alloy_recipe = function(metal1, count1, metal2, count2, result,
|
||||
end
|
||||
end
|
||||
|
||||
minetest.after(0.01, function ()
|
||||
for _, recipe in pairs(technic.alloy_recipes) do
|
||||
local in1 = recipe.input[1]
|
||||
local in2 = recipe.input[2]
|
||||
local in1n = in1.name
|
||||
local in2n = in2.name
|
||||
while minetest.registered_aliases[in1n] do
|
||||
in1n = minetest.registered_aliases[in1n]
|
||||
end
|
||||
while minetest.registered_aliases[in2n] do
|
||||
in2n = minetest.registered_aliases[in2n]
|
||||
end
|
||||
if in1n > in2n then
|
||||
local temp = in1
|
||||
in1 = in2
|
||||
in2 = temp
|
||||
temp = in1n
|
||||
in1n = in2n
|
||||
in2n = temp
|
||||
end
|
||||
technic.alloy_recipes[in1n.." "..in2n] = {
|
||||
input = {
|
||||
{ name = in1n, count = in1.count },
|
||||
{ name = in2n, count = in2.count },
|
||||
},
|
||||
output = recipe.output,
|
||||
}
|
||||
end
|
||||
end)
|
||||
|
||||
-- Retrieve a recipe given the input metals.
|
||||
function technic.get_alloy_recipe(stack1, stack2)
|
||||
-- Sort the stacks alphebetically
|
||||
@ -65,8 +95,12 @@ end
|
||||
|
||||
technic.register_alloy_recipe("technic:copper_dust", 3, "technic:tin_dust", 1, "technic:bronze_dust", 4)
|
||||
technic.register_alloy_recipe("default:copper_ingot", 3, "moreores:tin_ingot", 1, "moreores:bronze_ingot", 4)
|
||||
technic.register_alloy_recipe("technic:iron_dust", 3, "technic:chromium_dust", 1, "technic:stainless_steel_dust", 4)
|
||||
technic.register_alloy_recipe("default:steel_ingot", 3, "technic:chromium_ingot", 1, "technic:stainless_steel_ingot", 4)
|
||||
technic.register_alloy_recipe("technic:wrought_iron_dust", 1, "technic:coal_dust", 1, "technic:carbon_steel_dust", 1)
|
||||
technic.register_alloy_recipe("technic:wrought_iron_ingot", 1, "technic:coal_dust", 1, "technic:carbon_steel_ingot", 1)
|
||||
technic.register_alloy_recipe("technic:carbon_steel_dust", 1, "technic:coal_dust", 1, "technic:cast_iron_dust", 1)
|
||||
technic.register_alloy_recipe("technic:carbon_steel_ingot", 1, "technic:coal_dust", 1, "technic:cast_iron_ingot", 1)
|
||||
technic.register_alloy_recipe("technic:carbon_steel_dust", 3, "technic:chromium_dust", 1, "technic:stainless_steel_dust", 4)
|
||||
technic.register_alloy_recipe("technic:carbon_steel_ingot", 3, "technic:chromium_ingot", 1, "technic:stainless_steel_ingot", 4)
|
||||
technic.register_alloy_recipe("technic:copper_dust", 2, "technic:zinc_dust", 1, "technic:brass_dust", 3)
|
||||
technic.register_alloy_recipe("default:copper_ingot", 2, "technic:zinc_ingot", 1, "technic:brass_ingot", 3)
|
||||
technic.register_alloy_recipe("default:sand", 2, "technic:coal_dust", 2, "technic:silicon_wafer", 1)
|
||||
|
@ -24,6 +24,16 @@ function technic.register_grinder_recipe(data)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.after(0.01, function ()
|
||||
for ingredient, recipe in pairs(technic.grinder_recipes) do
|
||||
ingredient = minetest.registered_aliases[ingredient]
|
||||
while ingredient do
|
||||
technic.grinder_recipes[ingredient] = recipe
|
||||
ingredient = minetest.registered_aliases[ingredient]
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Receive an ItemStack of result by an ItemStack input
|
||||
function technic.get_grinder_recipe(itemstack)
|
||||
return technic.grinder_recipes[itemstack:get_name()]
|
||||
@ -40,8 +50,7 @@ local recipes = {
|
||||
{"default:gold_ingot", "technic:gold_dust 1"},
|
||||
{"default:gold_lump", "technic:gold_dust 2"},
|
||||
{"default:gravel", "default:dirt"},
|
||||
{"default:iron_lump", "technic:iron_dust 2"},
|
||||
{"default:steel_ingot", "technic:iron_dust 1"},
|
||||
{"default:iron_lump", "technic:wrought_iron_dust 2"},
|
||||
{"default:stone", "default:sand"},
|
||||
{"gloopores:alatro_lump", "technic:alatro_dust 2"},
|
||||
{"gloopores:kalite_lump", "technic:kalite_dust 2"},
|
||||
@ -54,8 +63,11 @@ local recipes = {
|
||||
{"moreores:silver_lump", "technic:silver_dust 2"},
|
||||
{"moreores:tin_ingot", "technic:tin_dust 1"},
|
||||
{"moreores:tin_lump", "technic:tin_dust 2"},
|
||||
{"technic:cast_iron_ingot", "technic:cast_iron_dust 1"},
|
||||
{"technic:chromium_ingot", "technic:chromium_dust 1"},
|
||||
{"technic:chromium_lump", "technic:chromium_dust 2"},
|
||||
{"technic:wrought_iron_ingot", "technic:wrought_iron_dust 1"},
|
||||
{"technic:carbon_steel_ingot", "technic:carbon_steel_dust 1"},
|
||||
{"technic:zinc_ingot", "technic:zinc_dust 1"},
|
||||
{"technic:zinc_lump", "technic:zinc_dust 2"},
|
||||
{"technic:brass_ingot", "technic:brass_dust 1"},
|
||||
@ -92,16 +104,18 @@ register_dust("Alatro", "glooptest:alatro_ingot")
|
||||
register_dust("Arol", "glooptest:arol_ingot")
|
||||
register_dust("Brass", "technic:brass_ingot")
|
||||
register_dust("Bronze", "default:bronze_ingot")
|
||||
register_dust("Carbon Steel", "technic:carbon_steel_ingot")
|
||||
register_dust("Cast Iron", "technic:cast_iron_ingot")
|
||||
register_dust("Chromium", "technic:chromium_ingot")
|
||||
register_dust("Coal", nil)
|
||||
register_dust("Copper", "default:copper_ingot")
|
||||
register_dust("Gold", "default:gold_ingot")
|
||||
register_dust("Iron", "default:steel_ingot")
|
||||
register_dust("Mithril", "moreores:mithril_ingot")
|
||||
register_dust("Silver", "moreores:silver_ingot")
|
||||
register_dust("Stainless Steel", "technic:stainless_steel_ingot")
|
||||
register_dust("Talinite", "glooptest:talinite_ingot")
|
||||
register_dust("Tin", "moreores:tin_ingot")
|
||||
register_dust("Wrought Iron", "technic:wrought_iron_ingot")
|
||||
register_dust("Zinc", "technic:zinc_ingot")
|
||||
|
||||
minetest.register_craft({
|
||||
|
@ -35,9 +35,9 @@ local S = technic.getter
|
||||
minetest.register_craft({
|
||||
output = "technic:switching_station",
|
||||
recipe = {
|
||||
{"default:steel_ingot", "technic:lv_transformer", "default:steel_ingot"},
|
||||
{"default:copper_ingot", "technic:lv_cable0", "default:copper_ingot"},
|
||||
{"default:steel_ingot", "technic:lv_cable0", "default:steel_ingot"}
|
||||
{"technic:cast_iron_ingot", "technic:lv_transformer", "technic:cast_iron_ingot"},
|
||||
{"default:copper_ingot", "technic:lv_cable0", "default:copper_ingot"},
|
||||
{"technic:cast_iron_ingot", "technic:lv_cable0", "technic:cast_iron_ingot"}
|
||||
}
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user