2015-01-11 22:21:33 +01:00
|
|
|
--[[
|
2015-01-12 17:46:22 +01:00
|
|
|
More Blocks: Stairs+
|
2015-01-11 22:21:33 +01:00
|
|
|
|
2020-01-01 04:09:24 +01:00
|
|
|
Copyright © 2011-2020 Hugo Locurcio and contributors.
|
2015-01-11 22:21:33 +01:00
|
|
|
Licensed under the zlib license. See LICENSE.md for more information.
|
|
|
|
--]]
|
|
|
|
|
2018-03-04 12:16:45 +01:00
|
|
|
-- Nodes will be called <modname>:{stair,slab,panel,micro,slope}_<subname>
|
2022-06-12 21:10:36 -07:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
local modpath = minetest.get_modpath(modname)
|
|
|
|
local S = minetest.get_translator(modname)
|
2014-03-09 10:38:18 +01:00
|
|
|
|
2022-06-12 21:10:36 -07:00
|
|
|
stairsplus = {
|
|
|
|
version = {3, 0, 0},
|
|
|
|
fork = "minetest_mods",
|
2014-03-09 10:38:18 +01:00
|
|
|
|
2022-06-12 21:10:36 -07:00
|
|
|
modname = modname,
|
|
|
|
modpath = modpath,
|
|
|
|
|
|
|
|
S = S,
|
|
|
|
|
|
|
|
has = {
|
|
|
|
basic_materials = minetest.get_modpath("basic_materials"),
|
|
|
|
default = minetest.get_modpath("default"),
|
|
|
|
gloopblocks = minetest.get_modpath("gloopblocks"),
|
|
|
|
stairs = minetest.get_modpath("stairs"),
|
|
|
|
technic = minetest.get_modpath("technic"),
|
|
|
|
prefab = minetest.get_modpath("prefab"),
|
|
|
|
wool = minetest.get_modpath("wool"),
|
|
|
|
},
|
|
|
|
|
|
|
|
log = function(level, messagefmt, ...)
|
|
|
|
return minetest.log(level, ("[%s] %s"):format(modname, messagefmt:format(...)))
|
|
|
|
end,
|
|
|
|
|
|
|
|
dofile = function(...)
|
|
|
|
return dofile(table.concat({modpath, ...}, DIR_DELIM) .. ".lua")
|
|
|
|
end,
|
|
|
|
}
|
2014-03-09 10:38:18 +01:00
|
|
|
|
2017-02-23 11:12:36 -05:00
|
|
|
stairsplus.shapes_list = {}
|
|
|
|
|
2014-03-09 10:38:18 +01:00
|
|
|
|
2015-11-01 17:54:29 +01:00
|
|
|
function stairsplus:prepare_groups(groups)
|
2016-01-26 12:52:55 -08:00
|
|
|
local result = {}
|
2015-11-01 17:54:29 +01:00
|
|
|
if groups then
|
|
|
|
for k, v in pairs(groups) do
|
2020-12-27 19:42:15 +01:00
|
|
|
if k ~= "wood" and k ~= "stone" and k ~= "wool" and k ~= "tree" then
|
2015-11-01 17:54:29 +01:00
|
|
|
result[k] = v
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2022-06-12 21:10:36 -07:00
|
|
|
|
|
|
|
if not stairsplus.settings.in_creative_inventory then
|
2015-11-01 17:54:29 +01:00
|
|
|
result.not_in_creative_inventory = 1
|
2014-03-09 10:38:18 +01:00
|
|
|
end
|
2022-06-12 21:10:36 -07:00
|
|
|
|
2015-11-01 17:54:29 +01:00
|
|
|
return result
|
|
|
|
end
|
|
|
|
|
|
|
|
function stairsplus:register_all(modname, subname, recipeitem, fields)
|
2014-03-09 10:38:18 +01:00
|
|
|
self:register_stair(modname, subname, recipeitem, fields)
|
2019-05-08 20:00:15 +02:00
|
|
|
self:register_slab(modname, subname, recipeitem, fields)
|
2014-10-28 22:12:40 +01:00
|
|
|
self:register_slope(modname, subname, recipeitem, fields)
|
2014-03-09 10:38:18 +01:00
|
|
|
self:register_panel(modname, subname, recipeitem, fields)
|
|
|
|
self:register_micro(modname, subname, recipeitem, fields)
|
|
|
|
end
|
|
|
|
|
2016-10-03 12:14:34 +02:00
|
|
|
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
|
|
|
|
|
2019-03-09 01:57:50 +01:00
|
|
|
local function register_stair_slab_panel_micro(modname, subname, recipeitem, groups, images, description, drop, light)
|
2014-03-09 10:38:18 +01:00
|
|
|
stairsplus:register_all(modname, subname, recipeitem, {
|
|
|
|
groups = groups,
|
|
|
|
tiles = images,
|
|
|
|
description = description,
|
|
|
|
drop = drop,
|
|
|
|
light_source = light
|
|
|
|
})
|
|
|
|
end
|
|
|
|
|
2018-03-03 16:42:46 +01:00
|
|
|
dofile(modpath .. "/defs.lua")
|
2018-03-04 12:16:45 +01:00
|
|
|
dofile(modpath .. "/recipes.lua")
|
2018-03-03 20:15:09 +01:00
|
|
|
dofile(modpath .. "/common.lua")
|
2014-10-28 22:12:40 +01:00
|
|
|
dofile(modpath .. "/stairs.lua")
|
|
|
|
dofile(modpath .. "/slabs.lua")
|
|
|
|
dofile(modpath .. "/slopes.lua")
|
|
|
|
dofile(modpath .. "/panels.lua")
|
|
|
|
dofile(modpath .. "/microblocks.lua")
|
2018-03-04 11:16:43 +01:00
|
|
|
dofile(modpath .. "/custom.lua")
|
2014-10-28 22:12:40 +01:00
|
|
|
dofile(modpath .. "/registrations.lua")
|