build a list of all of the stairsplus slab/stair/etc... shapes (#70)

for other mods to reference.
This commit is contained in:
Vanessa Ezekowitz 2017-02-23 11:12:36 -05:00 committed by Hugo Locurcio
parent 5f35766ed0
commit e9c6cef4dd
6 changed files with 22 additions and 0 deletions

View File

@ -12,6 +12,8 @@ local modpath = minetest.get_modpath("moreblocks").. "/stairsplus"
stairsplus = {} stairsplus = {}
stairsplus.expect_infinite_stacks = false stairsplus.expect_infinite_stacks = false
stairsplus.shapes_list = {}
if not minetest.get_modpath("unified_inventory") if not minetest.get_modpath("unified_inventory")
and minetest.setting_getbool("creative_mode") then and minetest.setting_getbool("creative_mode") then
stairsplus.expect_infinite_stacks = true stairsplus.expect_infinite_stacks = true

View File

@ -65,6 +65,10 @@ local microblocks_defs = {
} }
} }
for k,v in pairs(microblocks_defs) do
table.insert(stairsplus.shapes_list, { "micro_", k })
end
function stairsplus:register_micro_alias(modname_old, subname_old, modname_new, subname_new) function stairsplus:register_micro_alias(modname_old, subname_old, modname_new, subname_new)
local defs = stairsplus.copytable(microblocks_defs) local defs = stairsplus.copytable(microblocks_defs)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do

View File

@ -65,6 +65,10 @@ local panels_defs = {
} }
} }
for k,v in pairs(panels_defs) do
table.insert(stairsplus.shapes_list, { "panel_", k })
end
function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new) function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new)
local defs = stairsplus.copytable(panels_defs) local defs = stairsplus.copytable(panels_defs)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do

View File

@ -44,6 +44,10 @@ local slabs_defs = {
} }
} }
for k,v in pairs(slabs_defs) do
table.insert(stairsplus.shapes_list, { "slab_", k })
end
function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new) function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
local defs = stairsplus.copytable(slabs_defs) local defs = stairsplus.copytable(slabs_defs)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do

View File

@ -219,6 +219,10 @@ local slopes_defs = {
}, },
} }
for k,v in pairs(slopes_defs) do
table.insert(stairsplus.shapes_list, { "slope_", k })
end
function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new) function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new)
local defs = stairsplus.copytable(slopes_defs) local defs = stairsplus.copytable(slopes_defs)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do

View File

@ -105,6 +105,10 @@ local stairs_defs = {
}, },
} }
for k,v in pairs(stairs_defs) do
table.insert(stairsplus.shapes_list, { "stair_", k })
end
function stairsplus:register_stair_alias(modname_old, subname_old, modname_new, subname_new) function stairsplus:register_stair_alias(modname_old, subname_old, modname_new, subname_new)
local defs = stairsplus.copytable(stairs_defs) local defs = stairsplus.copytable(stairs_defs)
for alternate, def in pairs(defs) do for alternate, def in pairs(defs) do