2022-06-13 06:10:36 +02:00
|
|
|
-- legacy: register all the expected variants for e.g. default, wool, gloopblocks, etc.
|
|
|
|
-- provide a configuration option to *disable* legacy. it must be enabled by default, to prevent breaking
|
|
|
|
-- existing servers
|
2022-06-14 01:11:20 +02:00
|
|
|
local api = stairsplus.api
|
|
|
|
|
|
|
|
function stairsplus:register_all(modname, subname, recipeitem, fields)
|
|
|
|
api.register_all(recipeitem, fields)
|
|
|
|
|
2022-06-14 20:17:06 +02:00
|
|
|
local old_name = ("%s:%s"):format(modname, subname)
|
2022-06-14 01:11:20 +02:00
|
|
|
if old_name ~= recipeitem then
|
|
|
|
api.register_alias_all(old_name, recipeitem)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
function stairsplus:register_alias_all(modname_old, subname_old, modname_new, subname_new)
|
|
|
|
api.register_alias_all(
|
|
|
|
("%s:%s"):format(modname_old, subname_old),
|
|
|
|
("%s:%s"):format(modname_new, subname_new)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
function stairsplus:register_alias_force_all(modname_old, subname_old, modname_new, subname_new)
|
|
|
|
api.register_alias_force_all(
|
|
|
|
("%s:%s"):format(modname_old, subname_old),
|
|
|
|
("%s:%s"):format(modname_new, subname_new)
|
|
|
|
)
|
|
|
|
end
|