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,52 +20,67 @@ 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",
|
fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
|
||||||
fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
["_1"] = {
|
},
|
||||||
node_box = {
|
["_1"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0, -0.4375, 0.5},
|
||||||
},
|
},
|
||||||
["_2"] = {
|
},
|
||||||
node_box = {
|
["_2"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0, -0.375, 0.5},
|
||||||
},
|
},
|
||||||
["_4"] = {
|
},
|
||||||
node_box = {
|
["_4"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0, -0.25, 0.5},
|
||||||
},
|
},
|
||||||
["_12"] = {
|
},
|
||||||
node_box = {
|
["_12"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0, 0.25, 0.5},
|
||||||
},
|
},
|
||||||
["_14"] = {
|
},
|
||||||
node_box = {
|
["_14"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0, 0.375, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["_15"] = {
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5},
|
||||||
},
|
},
|
||||||
["_15"] = {
|
|
||||||
node_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.5, -0.5, 0, 0, 0.4375, 0.5},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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,52 +20,67 @@ 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",
|
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, 0, 0.5},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
["_1"] = {
|
},
|
||||||
node_box = {
|
["_1"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0.5, -0.4375, 0.5},
|
||||||
},
|
},
|
||||||
["_2"] = {
|
},
|
||||||
node_box = {
|
["_2"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0.5, -0.375, 0.5},
|
||||||
},
|
},
|
||||||
["_4"] = {
|
},
|
||||||
node_box = {
|
["_4"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0.5, -0.25, 0.5},
|
||||||
},
|
},
|
||||||
["_12"] = {
|
},
|
||||||
node_box = {
|
["_12"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0.5, 0.25, 0.5},
|
||||||
},
|
},
|
||||||
["_14"] = {
|
},
|
||||||
node_box = {
|
["_14"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5},
|
type = "fixed",
|
||||||
},
|
fixed = {-0.5, -0.5, 0, 0.5, 0.375, 0.5},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
["_15"] = {
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5},
|
||||||
},
|
},
|
||||||
["_15"] = {
|
|
||||||
node_box = {
|
|
||||||
type = "fixed",
|
|
||||||
fixed = {-0.5, -0.5, 0, 0.5, 0.4375, 0.5},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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,17 +20,32 @@ 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,
|
["_1"] = 1,
|
||||||
["_1"] = 1,
|
["_2"] = 2,
|
||||||
["_2"] = 2,
|
["_14"] = 14,
|
||||||
["_14"] = 14,
|
["_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,103 +123,118 @@ function register_slope(modname, subname, recipeitem, groups, images, descriptio
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local slopes_defs = {
|
||||||
|
[""] = {
|
||||||
|
mesh = "moreblocks_slope.obj",
|
||||||
|
collision_box = box_slope,
|
||||||
|
selection_box = box_slope,
|
||||||
|
|
||||||
|
},
|
||||||
|
["_half"] = {
|
||||||
|
mesh = "moreblocks_slope_half.obj",
|
||||||
|
collision_box = box_slope_half,
|
||||||
|
selection_box = box_slope_half,
|
||||||
|
},
|
||||||
|
["_half_raised"] = {
|
||||||
|
mesh = "moreblocks_slope_half_raised.obj",
|
||||||
|
collision_box = box_slope_half_raised,
|
||||||
|
selection_box = box_slope_half_raised,
|
||||||
|
},
|
||||||
|
|
||||||
|
--==============================================================
|
||||||
|
|
||||||
|
["_inner"] = {
|
||||||
|
mesh = "moreblocks_slope_inner.obj",
|
||||||
|
collision_box = box_slope_inner,
|
||||||
|
selection_box = box_slope_inner,
|
||||||
|
},
|
||||||
|
["_inner_half"] = {
|
||||||
|
mesh = "moreblocks_slope_inner_half.obj",
|
||||||
|
collision_box = box_slope_inner_half,
|
||||||
|
selection_box = box_slope_inner_half,
|
||||||
|
},
|
||||||
|
["_inner_half_raised"] = {
|
||||||
|
mesh = "moreblocks_slope_inner_half_raised.obj",
|
||||||
|
collision_box = box_slope_inner_half_raised,
|
||||||
|
selection_box = box_slope_inner_half_raised,
|
||||||
|
},
|
||||||
|
|
||||||
|
--==============================================================
|
||||||
|
|
||||||
|
["_inner_cut"] = {
|
||||||
|
mesh = "moreblocks_slope_inner_cut.obj",
|
||||||
|
collision_box = box_slope_inner,
|
||||||
|
selection_box = box_slope_inner,
|
||||||
|
},
|
||||||
|
["_inner_cut_half"] = {
|
||||||
|
mesh = "moreblocks_slope_inner_cut_half.obj",
|
||||||
|
collision_box = box_slope_inner_half,
|
||||||
|
selection_box = box_slope_inner_half,
|
||||||
|
},
|
||||||
|
["_inner_cut_half_raised"] = {
|
||||||
|
mesh = "moreblocks_slope_inner_cut_half_raised.obj",
|
||||||
|
collision_box = box_slope_inner_half_raised,
|
||||||
|
selection_box = box_slope_inner_half_raised,
|
||||||
|
},
|
||||||
|
|
||||||
|
--==============================================================
|
||||||
|
|
||||||
|
["_outer"] = {
|
||||||
|
mesh = "moreblocks_slope_outer.obj",
|
||||||
|
collision_box = box_slope_outer,
|
||||||
|
selection_box = box_slope_outer,
|
||||||
|
},
|
||||||
|
["_outer_half"] = {
|
||||||
|
mesh = "moreblocks_slope_outer_half.obj",
|
||||||
|
collision_box = box_slope_outer_half,
|
||||||
|
selection_box = box_slope_outer_half,
|
||||||
|
},
|
||||||
|
["_outer_half_raised"] = {
|
||||||
|
mesh = "moreblocks_slope_outer_half_raised.obj",
|
||||||
|
collision_box = box_slope_outer_half_raised,
|
||||||
|
selection_box = box_slope_outer_half_raised,
|
||||||
|
},
|
||||||
|
|
||||||
|
--==============================================================
|
||||||
|
|
||||||
|
["_outer_cut"] = {
|
||||||
|
mesh = "moreblocks_slope_outer_cut.obj",
|
||||||
|
collision_box = box_slope_outer,
|
||||||
|
selection_box = box_slope_outer,
|
||||||
|
},
|
||||||
|
["_outer_cut_half"] = {
|
||||||
|
mesh = "moreblocks_slope_outer_cut_half.obj",
|
||||||
|
collision_box = box_slope_outer_half,
|
||||||
|
selection_box = box_slope_outer_half,
|
||||||
|
},
|
||||||
|
["_outer_cut_half_raised"] = {
|
||||||
|
mesh = "moreblocks_slope_outer_cut_half_raised.obj",
|
||||||
|
collision_box = box_slope_outer_half_raised,
|
||||||
|
selection_box = box_slope_outer_half_raised,
|
||||||
|
},
|
||||||
|
["_cut"] = {
|
||||||
|
mesh = "moreblocks_slope_cut.obj",
|
||||||
|
collision_box = box_slope_outer,
|
||||||
|
selection_box = box_slope_outer,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
function stairsplus:register_slope(modname, subname, recipeitem, fields)
|
||||||
local defs = {
|
local defs = stairsplus.copytable(slopes_defs)
|
||||||
[""] = {
|
|
||||||
mesh = "moreblocks_slope.obj",
|
|
||||||
collision_box = box_slope,
|
|
||||||
selection_box = box_slope,
|
|
||||||
|
|
||||||
},
|
|
||||||
["_half"] = {
|
|
||||||
mesh = "moreblocks_slope_half.obj",
|
|
||||||
collision_box = box_slope_half,
|
|
||||||
selection_box = box_slope_half,
|
|
||||||
},
|
|
||||||
["_half_raised"] = {
|
|
||||||
mesh = "moreblocks_slope_half_raised.obj",
|
|
||||||
collision_box = box_slope_half_raised,
|
|
||||||
selection_box = box_slope_half_raised,
|
|
||||||
},
|
|
||||||
|
|
||||||
--==============================================================
|
|
||||||
|
|
||||||
["_inner"] = {
|
|
||||||
mesh = "moreblocks_slope_inner.obj",
|
|
||||||
collision_box = box_slope_inner,
|
|
||||||
selection_box = box_slope_inner,
|
|
||||||
},
|
|
||||||
["_inner_half"] = {
|
|
||||||
mesh = "moreblocks_slope_inner_half.obj",
|
|
||||||
collision_box = box_slope_inner_half,
|
|
||||||
selection_box = box_slope_inner_half,
|
|
||||||
},
|
|
||||||
["_inner_half_raised"] = {
|
|
||||||
mesh = "moreblocks_slope_inner_half_raised.obj",
|
|
||||||
collision_box = box_slope_inner_half_raised,
|
|
||||||
selection_box = box_slope_inner_half_raised,
|
|
||||||
},
|
|
||||||
|
|
||||||
--==============================================================
|
|
||||||
|
|
||||||
["_inner_cut"] = {
|
|
||||||
mesh = "moreblocks_slope_inner_cut.obj",
|
|
||||||
collision_box = box_slope_inner,
|
|
||||||
selection_box = box_slope_inner,
|
|
||||||
},
|
|
||||||
["_inner_cut_half"] = {
|
|
||||||
mesh = "moreblocks_slope_inner_cut_half.obj",
|
|
||||||
collision_box = box_slope_inner_half,
|
|
||||||
selection_box = box_slope_inner_half,
|
|
||||||
},
|
|
||||||
["_inner_cut_half_raised"] = {
|
|
||||||
mesh = "moreblocks_slope_inner_cut_half_raised.obj",
|
|
||||||
collision_box = box_slope_inner_half_raised,
|
|
||||||
selection_box = box_slope_inner_half_raised,
|
|
||||||
},
|
|
||||||
|
|
||||||
--==============================================================
|
|
||||||
|
|
||||||
["_outer"] = {
|
|
||||||
mesh = "moreblocks_slope_outer.obj",
|
|
||||||
collision_box = box_slope_outer,
|
|
||||||
selection_box = box_slope_outer,
|
|
||||||
},
|
|
||||||
["_outer_half"] = {
|
|
||||||
mesh = "moreblocks_slope_outer_half.obj",
|
|
||||||
collision_box = box_slope_outer_half,
|
|
||||||
selection_box = box_slope_outer_half,
|
|
||||||
},
|
|
||||||
["_outer_half_raised"] = {
|
|
||||||
mesh = "moreblocks_slope_outer_half_raised.obj",
|
|
||||||
collision_box = box_slope_outer_half_raised,
|
|
||||||
selection_box = box_slope_outer_half_raised,
|
|
||||||
},
|
|
||||||
|
|
||||||
--==============================================================
|
|
||||||
|
|
||||||
["_outer_cut"] = {
|
|
||||||
mesh = "moreblocks_slope_outer_cut.obj",
|
|
||||||
collision_box = box_slope_outer,
|
|
||||||
selection_box = box_slope_outer,
|
|
||||||
},
|
|
||||||
["_outer_cut_half"] = {
|
|
||||||
mesh = "moreblocks_slope_outer_cut_half.obj",
|
|
||||||
collision_box = box_slope_outer_half,
|
|
||||||
selection_box = box_slope_outer_half,
|
|
||||||
},
|
|
||||||
["_outer_cut_half_raised"] = {
|
|
||||||
mesh = "moreblocks_slope_outer_cut_half_raised.obj",
|
|
||||||
collision_box = box_slope_outer_half_raised,
|
|
||||||
selection_box = box_slope_outer_half_raised,
|
|
||||||
},
|
|
||||||
["_cut"] = {
|
|
||||||
mesh = "moreblocks_slope_cut.obj",
|
|
||||||
collision_box = box_slope_outer,
|
|
||||||
selection_box = box_slope_outer,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
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,92 +20,107 @@ 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",
|
fixed = {
|
||||||
fixed = {
|
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_half"] = {
|
},
|
||||||
node_box = {
|
["_half"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.5, -0.5, 0, 0, 0.5},
|
fixed = {
|
||||||
{-0.5, 0, 0, 0, 0.5, 0.5},
|
{-0.5, -0.5, -0.5, 0, 0, 0.5},
|
||||||
},
|
{-0.5, 0, 0, 0, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_right_half" ]= {
|
},
|
||||||
node_box = {
|
["_right_half" ]= {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{0, -0.5, -0.5, 0.5, 0, 0.5},
|
fixed = {
|
||||||
{0, 0, 0, 0.5, 0.5, 0.5},
|
{0, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
},
|
{0, 0, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_inner"] = {
|
},
|
||||||
node_box = {
|
["_inner"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
fixed = {
|
||||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
{-0.5, 0, -0.5, 0, 0.5, 0},
|
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
{-0.5, 0, -0.5, 0, 0.5, 0},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_outer"] = {
|
},
|
||||||
node_box = {
|
["_outer"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
fixed = {
|
||||||
{-0.5, 0, 0, 0, 0.5, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, 0, 0.5},
|
||||||
},
|
{-0.5, 0, 0, 0, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_alt"] = {
|
},
|
||||||
node_box = {
|
["_alt"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.5, -0.5, 0.5, 0, 0},
|
fixed = {
|
||||||
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
{-0.5, -0.5, -0.5, 0.5, 0, 0},
|
||||||
},
|
{-0.5, 0, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_alt_1"] = {
|
},
|
||||||
node_box = {
|
["_alt_1"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.0625, -0.5, 0.5, 0, 0},
|
fixed = {
|
||||||
{-0.5, 0.4375, 0, 0.5, 0.5, 0.5},
|
{-0.5, -0.0625, -0.5, 0.5, 0, 0},
|
||||||
},
|
{-0.5, 0.4375, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_alt_2"] = {
|
},
|
||||||
node_box = {
|
["_alt_2"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.125, -0.5, 0.5, 0, 0},
|
fixed = {
|
||||||
{-0.5, 0.375, 0, 0.5, 0.5, 0.5},
|
{-0.5, -0.125, -0.5, 0.5, 0, 0},
|
||||||
},
|
{-0.5, 0.375, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
["_alt_4"] = {
|
},
|
||||||
node_box = {
|
["_alt_4"] = {
|
||||||
type = "fixed",
|
node_box = {
|
||||||
fixed = {
|
type = "fixed",
|
||||||
{-0.5, -0.25, -0.5, 0.5, 0, 0},
|
fixed = {
|
||||||
{-0.5, 0.25, 0, 0.5, 0.5, 0.5},
|
{-0.5, -0.25, -0.5, 0.5, 0, 0},
|
||||||
},
|
{-0.5, 0.25, 0, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
@ -127,7 +142,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
|||||||
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
circular_saw.known_nodes[recipeitem] = {modname, subname}
|
||||||
|
|
||||||
-- Some saw-less recipes:
|
-- Some saw-less recipes:
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = modname .. ":stair_" .. subname .. " 8",
|
output = modname .. ":stair_" .. subname .. " 8",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -145,67 +160,67 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
|||||||
{recipeitem, recipeitem, recipeitem},
|
{recipeitem, recipeitem, recipeitem},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname,
|
output = modname .. ":stair_" .. subname,
|
||||||
recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname},
|
recipe = {modname .. ":panel_" .. subname, modname .. ":slab_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname,
|
output = modname .. ":stair_" .. subname,
|
||||||
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
|
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname .. "_outer",
|
output = modname .. ":stair_" .. subname .. "_outer",
|
||||||
recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname},
|
recipe = {modname .. ":micro_" .. subname, modname .. ":slab_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname .. "_half",
|
output = modname .. ":stair_" .. subname .. "_half",
|
||||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname .. "_half",
|
output = modname .. ":stair_" .. subname .. "_half",
|
||||||
recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname},
|
recipe = {modname .. ":panel_" .. subname, modname .. ":micro_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname .. "_right_half",
|
output = modname .. ":stair_" .. subname .. "_right_half",
|
||||||
recipe = {modname .. ":stair_" .. subname .. "_half"},
|
recipe = {modname .. ":stair_" .. subname .. "_half"},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname,
|
output = modname .. ":stair_" .. subname,
|
||||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname .. "_inner",
|
output = modname .. ":stair_" .. subname .. "_inner",
|
||||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname .. "_outer",
|
output = modname .. ":stair_" .. subname .. "_outer",
|
||||||
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
recipe = {modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname, modname .. ":micro_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = modname .. ":stair_" .. subname,
|
output = modname .. ":stair_" .. subname,
|
||||||
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
|
recipe = {modname .. ":panel_" .. subname, modname .. ":panel_" .. subname, modname .. ":panel_" .. subname},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({ -- See mirrored variation of the recipe below.
|
minetest.register_craft({ -- See mirrored variation of the recipe below.
|
||||||
output = modname .. ":stair_" .. subname .. "_alt",
|
output = modname .. ":stair_" .. subname .. "_alt",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -213,7 +228,7 @@ function stairsplus:register_stair(modname, subname, recipeitem, fields)
|
|||||||
{"" , modname .. ":panel_" .. subname},
|
{"" , modname .. ":panel_" .. subname},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({ -- Mirrored variation of the recipe above.
|
minetest.register_craft({ -- Mirrored variation of the recipe above.
|
||||||
output = modname .. ":stair_" .. subname .. "_alt",
|
output = modname .. ":stair_" .. subname .. "_alt",
|
||||||
recipe = {
|
recipe = {
|
||||||
|
Loading…
Reference in New Issue
Block a user