forked from VoxeLibre/VoxeLibre
Fix code errors
This commit is contained in:
parent
b5e00c1ea2
commit
0b40c1eb62
|
@ -60,12 +60,6 @@ end
|
||||||
---@param decay_chain table
|
---@param decay_chain table
|
||||||
local function register_oxidation_and_scraping(mod_name, subname, decay_chain)
|
local function register_oxidation_and_scraping(mod_name, subname, decay_chain)
|
||||||
local item, oxidized_item
|
local item, oxidized_item
|
||||||
-- Handling special decay chain names.
|
|
||||||
if mod_name == "mcl_stairs" then
|
|
||||||
for i = 1, 4 do
|
|
||||||
decay_chain[i] = decay_chain[i].."_cut"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for i = 1, #decay_chain - 1 do
|
for i = 1, #decay_chain - 1 do
|
||||||
item = mod_name..":"..subname..decay_chain[i]
|
item = mod_name..":"..subname..decay_chain[i]
|
||||||
|
@ -124,18 +118,12 @@ end
|
||||||
--- containing the list of subnames of the block oxidation chain (without the waxed variants subnames).
|
--- containing the list of subnames of the block oxidation chain (without the waxed variants subnames).
|
||||||
local function register_waxing_and_scraping(mod_name, subname, decay_chain)
|
local function register_waxing_and_scraping(mod_name, subname, decay_chain)
|
||||||
local waxed_item, unwaxed_item
|
local waxed_item, unwaxed_item
|
||||||
-- Handling special decay chain names.
|
|
||||||
if mod_name == "mcl_stairs" then
|
|
||||||
for i = 1, 4 do
|
|
||||||
decay_chain[i] = decay_chain[i].."_cut"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for i = 1, #decay_chain do
|
for i = 1, #decay_chain do
|
||||||
waxed_item = mod_name..":"..subname..decay_chain[i]
|
waxed_item = mod_name..":"..subname..decay_chain[i]
|
||||||
unwaxed_item = mod_name..":"..subname:gsub("waxed_", "")..decay_chain[i]
|
unwaxed_item = mod_name..":"..subname:gsub("waxed_", "")..decay_chain[i]
|
||||||
|
|
||||||
for _, subnode in pairs(mcl_copper.subnodes[subname]) do
|
for _, subnode in pairs(mcl_copper.subnodes[subname:gsub("waxed_", "")]) do
|
||||||
if subnode == "" then
|
if subnode == "" then
|
||||||
minetest.override_item(waxed_item, {_mcl_stripped_variant = unwaxed_item})
|
minetest.override_item(waxed_item, {_mcl_stripped_variant = unwaxed_item})
|
||||||
minetest.override_item(unwaxed_item, {_mcl_waxed_variant = waxed_item})
|
minetest.override_item(unwaxed_item, {_mcl_waxed_variant = waxed_item})
|
||||||
|
@ -193,8 +181,6 @@ local mods_and_blocks = {
|
||||||
{"mesecons_button", "button_copper", "button_waxed_copper"},
|
{"mesecons_button", "button_copper", "button_waxed_copper"},
|
||||||
{"mcl_copper", "door", "waxed_door"},
|
{"mcl_copper", "door", "waxed_door"},
|
||||||
{"mcl_copper", "pressure_plate_copper", "pressure_plate_waxed_copper"},
|
{"mcl_copper", "pressure_plate_copper", "pressure_plate_waxed_copper"},
|
||||||
{"mcl_stairs", "slab_copper", "slab_waxed_copper"},
|
|
||||||
{"mcl_stairs", "stair_copper", "stair_waxed_copper"},
|
|
||||||
{"mcl_copper", "trapdoor", "waxed_trapdoor"}
|
{"mcl_copper", "trapdoor", "waxed_trapdoor"}
|
||||||
}
|
}
|
||||||
-- Defining variants for all blocks registered by other API's.
|
-- Defining variants for all blocks registered by other API's.
|
||||||
|
@ -206,3 +192,21 @@ for _, mod_and_blocks in pairs(mods_and_blocks) do
|
||||||
register_oxidation_and_scraping(mod, oxidize_and_scrap, decay_chain)
|
register_oxidation_and_scraping(mod, oxidize_and_scrap, decay_chain)
|
||||||
register_waxing_and_scraping(mod, wax_and_scrap, decay_chain)
|
register_waxing_and_scraping(mod, wax_and_scrap, decay_chain)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
for i = 1, 4 do
|
||||||
|
decay_chain[i] = decay_chain[i].."_cut"
|
||||||
|
end
|
||||||
|
|
||||||
|
mods_and_blocks = {
|
||||||
|
{"mcl_stairs", "slab_copper", "slab_waxed_copper"},
|
||||||
|
{"mcl_stairs", "stair_copper", "stair_waxed_copper"}
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, mod_and_blocks in pairs(mods_and_blocks) do
|
||||||
|
local mod = mod_and_blocks[1]
|
||||||
|
local oxidize_and_scrap = mod_and_blocks[2]
|
||||||
|
local wax_and_scrap = mod_and_blocks[3]
|
||||||
|
|
||||||
|
register_oxidation_and_scraping(mod, oxidize_and_scrap, decay_chain)
|
||||||
|
register_waxing_and_scraping(mod, wax_and_scrap, decay_chain)
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue