forked from minetest-mods/moreblocks
parent
ab2c63270f
commit
7f06db2200
@ -17,6 +17,21 @@ and minetest.setting_getbool("creative_mode") then
|
|||||||
stairsplus.expect_infinite_stacks = true
|
stairsplus.expect_infinite_stacks = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function stairsplus.copytable(orig)
|
||||||
|
local orig_type = type(orig)
|
||||||
|
local copy
|
||||||
|
if orig_type == 'table' then
|
||||||
|
copy = {}
|
||||||
|
for orig_key, orig_value in next, orig, nil do
|
||||||
|
copy[stairsplus.copytable(orig_key)] = stairsplus.copytable(orig_value)
|
||||||
|
end
|
||||||
|
setmetatable(copy, stairsplus.copytable(getmetatable(orig)))
|
||||||
|
else
|
||||||
|
copy = orig
|
||||||
|
end
|
||||||
|
return copy
|
||||||
|
end
|
||||||
|
|
||||||
function stairsplus:prepare_groups(groups)
|
function stairsplus:prepare_groups(groups)
|
||||||
local result = {}
|
local result = {}
|
||||||
if groups then
|
if groups then
|
||||||
@ -41,6 +56,21 @@ function stairsplus:register_all(modname, subname, recipeitem, fields)
|
|||||||
-- self:register_6dfacedir_conversion(modname, subname) -- Not needed as of Q3 2013, uncomment to fix old maps.
|
-- self:register_6dfacedir_conversion(modname, subname) -- Not needed as of Q3 2013, uncomment to fix old maps.
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_alias_all(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_stair_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_slope_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_panel_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_micro_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
end
|
||||||
|
function stairsplus:register_alias_force_all(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_stair_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_slab_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_slope_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_panel_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
self:register_micro_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
end
|
||||||
|
|
||||||
function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
|
function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
|
||||||
stairsplus:register_all(modname, subname, recipeitem, {
|
stairsplus:register_all(modname, subname, recipeitem, {
|
||||||
groups = groups,
|
groups = groups,
|
||||||
|
@ -20,8 +20,7 @@ function register_micro(modname, subname, recipeitem, groups, images, descriptio
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
local microblocks_defs = {
|
||||||
local defs = {
|
|
||||||
[""] = {
|
[""] = {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -66,6 +65,22 @@ function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stairsplus:register_micro_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(microblocks_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias(modname_old .. ":micro_" .. subname_old .. alternate, modname_new .. ":micro_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_micro_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(microblocks_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias_force(modname_old .. ":micro_" .. subname_old .. alternate, modname_new .. ":micro_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_micro(modname, subname, recipeitem, fields)
|
||||||
|
local defs = stairsplus.copytable(microblocks_defs)
|
||||||
local desc = S("%s Microblock"):format(fields.description)
|
local desc = S("%s Microblock"):format(fields.description)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
for k, v in pairs(fields) do
|
for k, v in pairs(fields) do
|
||||||
|
@ -20,8 +20,7 @@ function register_panel(modname, subname, recipeitem, groups, images, descriptio
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
local panels_defs = {
|
||||||
local defs = {
|
|
||||||
[""] = {
|
[""] = {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -66,6 +65,22 @@ function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(panels_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias(modname_old .. ":panel_" .. subname_old .. alternate, modname_new .. ":panel_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_panel_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(panels_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias_force(modname_old .. ":panel_" .. subname_old .. alternate, modname_new .. ":panel_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_panel(modname, subname, recipeitem, fields)
|
||||||
|
local defs = stairsplus.copytable(panels_defs)
|
||||||
local desc = S("%s Panel"):format(fields.description)
|
local desc = S("%s Panel"):format(fields.description)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
for k, v in pairs(fields) do
|
for k, v in pairs(fields) do
|
||||||
|
@ -20,8 +20,7 @@ function register_slab(modname, subname, recipeitem, groups, images, description
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
local slabs_defs = {
|
||||||
local defs = {
|
|
||||||
[""] = 8,
|
[""] = 8,
|
||||||
["_quarter"] = 4,
|
["_quarter"] = 4,
|
||||||
["_three_quarter"] = 12,
|
["_three_quarter"] = 12,
|
||||||
@ -31,6 +30,22 @@ function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
|||||||
["_15"] = 15,
|
["_15"] = 15,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stairsplus:register_slab_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(slabs_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias(modname_old .. ":slab_" .. subname_old .. alternate, modname_new .. ":slab_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_slab_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(slabs_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias_force(modname_old .. ":slab_" .. subname_old .. alternate, modname_new .. ":slab_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_slab(modname, subname, recipeitem, fields)
|
||||||
|
local defs = stairsplus.copytable(slabs_defs)
|
||||||
local desc_base = S("%s Slab"):format(fields.description)
|
local desc_base = S("%s Slab"):format(fields.description)
|
||||||
for alternate, num in pairs(defs) do
|
for alternate, num in pairs(defs) do
|
||||||
local def = {
|
local def = {
|
||||||
|
@ -123,8 +123,7 @@ function register_slope(modname, subname, recipeitem, groups, images, descriptio
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
local slopes_defs = {
|
||||||
local defs = {
|
|
||||||
[""] = {
|
[""] = {
|
||||||
mesh = "moreblocks_slope.obj",
|
mesh = "moreblocks_slope.obj",
|
||||||
collision_box = box_slope,
|
collision_box = box_slope,
|
||||||
@ -220,6 +219,22 @@ function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stairsplus:register_slope_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(slopes_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias(modname_old .. ":slope_" .. subname_old .. alternate, modname_new .. ":slope_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_slope_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(slopes_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias_force(modname_old .. ":slope_" .. subname_old .. alternate, modname_new .. ":slope_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||||
|
local defs = stairsplus.copytable(slopes_defs)
|
||||||
local desc = S("%s Slope"):format(fields.description)
|
local desc = S("%s Slope"):format(fields.description)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
for k, v in pairs(fields) do
|
for k, v in pairs(fields) do
|
||||||
|
@ -20,8 +20,7 @@ function register_stair(modname, subname, recipeitem, groups, images, descriptio
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
local stairs_defs = {
|
||||||
local defs = {
|
|
||||||
[""] = {
|
[""] = {
|
||||||
node_box = {
|
node_box = {
|
||||||
type = "fixed",
|
type = "fixed",
|
||||||
@ -106,6 +105,22 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function stairsplus:register_stair_alias(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(stairs_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias(modname_old .. ":stair_" .. subname_old .. alternate, modname_new .. ":stair_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_stair_alias_force(modname_old, subname_old, modname_new, subname_new)
|
||||||
|
local defs = stairsplus.copytable(stairs_defs)
|
||||||
|
for alternate, def in pairs(defs) do
|
||||||
|
minetest.register_alias_force(modname_old .. ":stair_" .. subname_old .. alternate, modname_new .. ":stair_" .. subname_new .. alternate)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
||||||
|
local defs = stairsplus.copytable(stairs_defs)
|
||||||
local desc = S("%s Stairs"):format(fields.description)
|
local desc = S("%s Stairs"):format(fields.description)
|
||||||
for alternate, def in pairs(defs) do
|
for alternate, def in pairs(defs) do
|
||||||
for k, v in pairs(fields) do
|
for k, v in pairs(fields) do
|
||||||
|
Loading…
Reference in New Issue
Block a user