mirror of
https://github.com/minetest-mods/technic.git
synced 2025-01-11 10:40:19 +01:00
Allow disabling the steel->wrought iron overrides
This commit is contained in:
parent
43acec2900
commit
a9ad38d095
@ -6,6 +6,7 @@ local defaults = {
|
|||||||
enable_granite_generation = "true",
|
enable_granite_generation = "true",
|
||||||
enable_marble_generation = "true",
|
enable_marble_generation = "true",
|
||||||
enable_rubber_tree_generation = "true",
|
enable_rubber_tree_generation = "true",
|
||||||
|
enable_steel_override = "true",
|
||||||
}
|
}
|
||||||
|
|
||||||
for k, v in pairs(defaults) do
|
for k, v in pairs(defaults) do
|
||||||
|
@ -166,8 +166,9 @@ local function for_each_registered_item(action)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local steel_to_iron = {}
|
if technic.config:get_bool("enable_steel_override") then
|
||||||
for _, i in ipairs({
|
local steel_to_iron = {}
|
||||||
|
for _, i in ipairs({
|
||||||
"default:axe_steel",
|
"default:axe_steel",
|
||||||
"default:pick_steel",
|
"default:pick_steel",
|
||||||
"default:shovel_steel",
|
"default:shovel_steel",
|
||||||
@ -180,13 +181,14 @@ for _, i in ipairs({
|
|||||||
"mesecons_doors:op_door_steel",
|
"mesecons_doors:op_door_steel",
|
||||||
"mesecons_doors:sig_door_steel",
|
"mesecons_doors:sig_door_steel",
|
||||||
"vessels:steel_bottle",
|
"vessels:steel_bottle",
|
||||||
}) do
|
}) do
|
||||||
steel_to_iron[i] = true
|
steel_to_iron[i] = true
|
||||||
end
|
end
|
||||||
|
|
||||||
for_each_registered_item(function(item_name)
|
for_each_registered_item(function(item_name)
|
||||||
local item_def = minetest.registered_items[item_name]
|
local item_def = minetest.registered_items[item_name]
|
||||||
if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then
|
if steel_to_iron[item_name] and string.find(item_def.description, "Steel") then
|
||||||
minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) })
|
minetest.override_item(item_name, { description = string.gsub(item_def.description, "Steel", S("Iron")) })
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
@ -104,11 +104,6 @@ minetest.register_node(":technic:lead_block", {
|
|||||||
|
|
||||||
minetest.register_alias("technic:wrought_iron_block", "default:steelblock")
|
minetest.register_alias("technic:wrought_iron_block", "default:steelblock")
|
||||||
|
|
||||||
minetest.override_item("default:steelblock", {
|
|
||||||
description = S("Wrought Iron Block"),
|
|
||||||
tiles = { "technic_wrought_iron_block.png" },
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_node(":technic:cast_iron_block", {
|
minetest.register_node(":technic:cast_iron_block", {
|
||||||
description = S("Cast Iron Block"),
|
description = S("Cast Iron Block"),
|
||||||
tiles = { "technic_cast_iron_block.png" },
|
tiles = { "technic_cast_iron_block.png" },
|
||||||
@ -156,7 +151,13 @@ local function for_each_registered_node(action)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
for_each_registered_node(function(node_name, node_def)
|
if technic.config:get_bool("enable_steel_override") then
|
||||||
|
minetest.override_item("default:steelblock", {
|
||||||
|
description = S("Wrought Iron Block"),
|
||||||
|
tiles = { "technic_wrought_iron_block.png" },
|
||||||
|
})
|
||||||
|
|
||||||
|
for_each_registered_node(function(node_name, node_def)
|
||||||
if node_name ~= "default:steelblock" and
|
if node_name ~= "default:steelblock" and
|
||||||
node_name:find("steelblock", 1, true) and
|
node_name:find("steelblock", 1, true) and
|
||||||
node_def.description:find("Steel", 1, true) then
|
node_def.description:find("Steel", 1, true) then
|
||||||
@ -184,5 +185,6 @@ for_each_registered_node(function(node_name, node_def)
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user