2024-02-14 12:13:19 +00:00
|
|
|
function mcl_copper.register_oxidation_and_scraping(mod_name, subname, decay_chain)
|
|
|
|
local item, oxidized_item
|
|
|
|
|
|
|
|
for i = 1, #decay_chain - 1 do
|
|
|
|
item = mod_name..":"..subname..decay_chain[i]
|
|
|
|
oxidized_item = mod_name..":"..subname..decay_chain[i + 1]
|
|
|
|
|
|
|
|
minetest.override_item(item, {_mcl_oxidized_variant = oxidized_item})
|
|
|
|
minetest.override_item(oxidized_item, {_mcl_stripped_variant = item})
|
|
|
|
|
|
|
|
if subname:find("stair") then
|
|
|
|
minetest.override_item(item.."_inner", {_mcl_oxidized_variant = oxidized_item.."_inner"})
|
|
|
|
minetest.override_item(item.."_outer", {_mcl_oxidized_variant = oxidized_item.."_outer"})
|
|
|
|
minetest.override_item(oxidized_item.."_inner", {_mcl_stripped_variant = item.."_inner"})
|
|
|
|
minetest.override_item(oxidized_item.."_outer", {_mcl_stripped_variant = item.."_outer"})
|
|
|
|
elseif subname:find("slab") then
|
|
|
|
minetest.override_item(item.."_double", {_mcl_oxidized_variant = oxidized_item.."_double"})
|
|
|
|
minetest.override_item(item.."_top", {_mcl_oxidized_variant = oxidized_item.."_top"})
|
|
|
|
minetest.override_item(oxidized_item.."_double", {_mcl_stripped_variant = item.."_double"})
|
|
|
|
minetest.override_item(oxidized_item.."_top", {_mcl_stripped_variant = item.."_top"})
|
2024-02-14 20:34:39 +00:00
|
|
|
elseif subname:find("trapdoor") then
|
|
|
|
minetest.override_item(item.."_open", {_mcl_oxidized_variant = oxidized_item.."_open"})
|
|
|
|
minetest.override_item(oxidized_item.."_open", {_mcl_stripped_variant = item.."_open"})
|
2024-02-16 15:35:43 +00:00
|
|
|
elseif subname == "door" then
|
|
|
|
minetest.override_item(item.."_b_1", {_mcl_oxidized_variant = oxidized_item.."_b_1"})
|
|
|
|
minetest.override_item(oxidized_item.."_b_1", {_mcl_stripped_variant = item.."_b_1"})
|
|
|
|
minetest.override_item(item.."_t_1", {_mcl_oxidized_variant = oxidized_item.."_t_1"})
|
|
|
|
minetest.override_item(oxidized_item.."_t_1", {_mcl_stripped_variant = item.."_t_1"})
|
|
|
|
|
|
|
|
minetest.override_item(item.."_b_2", {_mcl_oxidized_variant = oxidized_item.."_b_2"})
|
|
|
|
minetest.override_item(oxidized_item.."_b_2", {_mcl_stripped_variant = item.."_b_2"})
|
|
|
|
minetest.override_item(item.."_t_2", {_mcl_oxidized_variant = oxidized_item.."_t_2"})
|
|
|
|
minetest.override_item(oxidized_item.."_t_2", {_mcl_stripped_variant = item.."_t_2"})
|
2024-02-16 18:32:25 +00:00
|
|
|
|
|
|
|
minetest.override_item(item.."_b_3", {_mcl_oxidized_variant = oxidized_item.."_b_3"})
|
|
|
|
minetest.override_item(oxidized_item.."_b_3", {_mcl_stripped_variant = item.."_b_3"})
|
|
|
|
minetest.override_item(item.."_t_3", {_mcl_oxidized_variant = oxidized_item.."_t_3"})
|
|
|
|
minetest.override_item(oxidized_item.."_t_3", {_mcl_stripped_variant = item.."_t_3"})
|
|
|
|
|
|
|
|
minetest.override_item(item.."_b_4", {_mcl_oxidized_variant = oxidized_item.."_b_4"})
|
|
|
|
minetest.override_item(oxidized_item.."_b_4", {_mcl_stripped_variant = item.."_b_4"})
|
|
|
|
minetest.override_item(item.."_t_4", {_mcl_oxidized_variant = oxidized_item.."_t_4"})
|
|
|
|
minetest.override_item(oxidized_item.."_t_4", {_mcl_stripped_variant = item.."_t_4"})
|
2024-02-14 12:13:19 +00:00
|
|
|
end
|
2023-02-15 18:59:39 +00:00
|
|
|
end
|
2024-02-14 12:13:19 +00:00
|
|
|
end
|
2023-02-15 19:55:41 +00:00
|
|
|
|
2024-02-14 12:13:19 +00:00
|
|
|
function mcl_copper.register_waxing_and_scraping(mod_name, subname, decay_chain)
|
|
|
|
local waxed_item, unwaxed_item
|
|
|
|
|
|
|
|
for i = 1, #decay_chain do
|
|
|
|
waxed_item = mod_name..":"..subname..decay_chain[i]
|
|
|
|
unwaxed_item = mod_name..":"..subname:gsub("waxed_", "")..decay_chain[i]
|
|
|
|
|
|
|
|
minetest.override_item(waxed_item, {_mcl_stripped_variant = unwaxed_item})
|
|
|
|
minetest.override_item(unwaxed_item, {_mcl_waxed_variant = waxed_item})
|
|
|
|
|
|
|
|
if subname:find("stair") then
|
|
|
|
minetest.override_item(waxed_item.."_inner", {_mcl_stripped_variant = unwaxed_item.."_inner"})
|
|
|
|
minetest.override_item(waxed_item.."_outer", {_mcl_stripped_variant = unwaxed_item.."_outer"})
|
|
|
|
minetest.override_item(unwaxed_item.."_inner", {_mcl_waxed_variant = waxed_item.."_inner"})
|
|
|
|
minetest.override_item(unwaxed_item.."_outer", {_mcl_waxed_variant = waxed_item.."_outer"})
|
|
|
|
elseif subname:find("slab") then
|
|
|
|
minetest.override_item(waxed_item.."_double", {_mcl_stripped_variant = unwaxed_item.."_double"})
|
|
|
|
minetest.override_item(waxed_item.."_top", {_mcl_stripped_variant = unwaxed_item.."_top"})
|
|
|
|
minetest.override_item(unwaxed_item.."_double", {_mcl_waxed_variant = waxed_item.."_double"})
|
|
|
|
minetest.override_item(unwaxed_item.."_top", {_mcl_waxed_variant = waxed_item.."_top"})
|
2024-02-14 20:34:39 +00:00
|
|
|
elseif subname:find("trapdoor") then
|
|
|
|
minetest.override_item(waxed_item.."_open", {_mcl_stripped_variant = unwaxed_item.."_open"})
|
|
|
|
minetest.override_item(unwaxed_item.."_open", {_mcl_waxed_variant = waxed_item.."_open"})
|
2024-02-16 15:35:43 +00:00
|
|
|
elseif subname == "waxed_door" then
|
|
|
|
minetest.override_item(waxed_item.."_b_1", {_mcl_stripped_variant = unwaxed_item.."_b_1"})
|
|
|
|
minetest.override_item(unwaxed_item.."_b_1", {_mcl_waxed_variant = waxed_item.."_b_1"})
|
|
|
|
minetest.override_item(waxed_item.."_t_1", {_mcl_stripped_variant = unwaxed_item.."_t_1"})
|
|
|
|
minetest.override_item(unwaxed_item.."_t_1", {_mcl_waxed_variant = waxed_item.."_t_1"})
|
|
|
|
|
|
|
|
minetest.override_item(waxed_item.."_b_2", {_mcl_stripped_variant = unwaxed_item.."_b_2"})
|
|
|
|
minetest.override_item(unwaxed_item.."_b_2", {_mcl_waxed_variant = waxed_item.."_b_2"})
|
|
|
|
minetest.override_item(waxed_item.."_t_2", {_mcl_stripped_variant = unwaxed_item.."_t_2"})
|
|
|
|
minetest.override_item(unwaxed_item.."_t_2", {_mcl_waxed_variant = waxed_item.."_t_2"})
|
2024-02-16 18:32:25 +00:00
|
|
|
|
|
|
|
minetest.override_item(waxed_item.."_b_3", {_mcl_stripped_variant = unwaxed_item.."_b_3"})
|
|
|
|
minetest.override_item(unwaxed_item.."_b_3", {_mcl_waxed_variant = waxed_item.."_b_3"})
|
|
|
|
minetest.override_item(waxed_item.."_t_3", {_mcl_stripped_variant = unwaxed_item.."_t_3"})
|
|
|
|
minetest.override_item(unwaxed_item.."_t_3", {_mcl_waxed_variant = waxed_item.."_t_3"})
|
|
|
|
|
|
|
|
minetest.override_item(waxed_item.."_b_4", {_mcl_stripped_variant = unwaxed_item.."_b_4"})
|
|
|
|
minetest.override_item(unwaxed_item.."_b_4", {_mcl_waxed_variant = waxed_item.."_b_4"})
|
|
|
|
minetest.override_item(waxed_item.."_t_4", {_mcl_stripped_variant = unwaxed_item.."_t_4"})
|
|
|
|
minetest.override_item(unwaxed_item.."_t_4", {_mcl_waxed_variant = waxed_item.."_t_4"})
|
2024-02-14 12:13:19 +00:00
|
|
|
end
|
2023-02-15 18:59:39 +00:00
|
|
|
end
|
|
|
|
end
|
2022-05-04 09:07:04 +00:00
|
|
|
|
2024-02-14 12:13:19 +00:00
|
|
|
local cut_decay_chain = {
|
|
|
|
"_cut",
|
|
|
|
"_exposed_cut",
|
|
|
|
"_weathered_cut",
|
|
|
|
"_oxidized_cut"
|
2023-02-15 19:55:41 +00:00
|
|
|
}
|
2024-02-16 15:35:43 +00:00
|
|
|
local doors_decay_chain = {
|
2024-02-14 12:13:19 +00:00
|
|
|
"",
|
|
|
|
"_exposed",
|
|
|
|
"_weathered",
|
|
|
|
"_oxidized"
|
2023-05-20 16:44:54 +00:00
|
|
|
}
|
|
|
|
|
2024-02-14 12:13:19 +00:00
|
|
|
mcl_copper.register_oxidation_and_scraping("mcl_stairs", "stair_copper", cut_decay_chain)
|
|
|
|
mcl_copper.register_oxidation_and_scraping("mcl_stairs", "slab_copper", cut_decay_chain)
|
2024-02-16 15:35:43 +00:00
|
|
|
mcl_copper.register_oxidation_and_scraping("mcl_copper", "trapdoor", doors_decay_chain)
|
|
|
|
mcl_copper.register_oxidation_and_scraping("mcl_copper", "door", doors_decay_chain)
|
2024-02-14 12:13:19 +00:00
|
|
|
mcl_copper.register_waxing_and_scraping("mcl_stairs", "stair_waxed_copper", cut_decay_chain)
|
|
|
|
mcl_copper.register_waxing_and_scraping("mcl_stairs", "slab_waxed_copper", cut_decay_chain)
|
2024-02-16 15:35:43 +00:00
|
|
|
mcl_copper.register_waxing_and_scraping("mcl_copper", "waxed_trapdoor", doors_decay_chain)
|
|
|
|
mcl_copper.register_waxing_and_scraping("mcl_copper", "waxed_door", doors_decay_chain)
|