panels.lua 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --[[
  2. More Blocks: panel definitions
  3. Copyright © 2011-2020 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. -- Node will be called <modname>:panel_<subname>
  7. -- luacheck: no unused
  8. local function register_panel(modname, subname, recipeitem, groups, images, description, drop, light)
  9. stairsplus:register_panel(modname, subname, recipeitem, {
  10. groups = groups,
  11. tiles = images,
  12. description = description,
  13. drop = drop,
  14. light_source = light,
  15. sounds = default.node_sound_stone_defaults(),
  16. })
  17. end
  18. function stairsplus:register_panel_alias(modname_old, subname_old, modname_new, subname_new)
  19. local defs = table.copy(stairsplus.defs["panel"])
  20. for alternate, def in pairs(defs) do
  21. minetest.register_alias(modname_old .. ":panel_" .. subname_old .. alternate, modname_new .. ":panel_" .. subname_new .. alternate)
  22. end
  23. end
  24. function stairsplus:register_panel_alias_force(modname_old, subname_old, modname_new, subname_new)
  25. local defs = table.copy(stairsplus.defs["panel"])
  26. for alternate, def in pairs(defs) do
  27. minetest.register_alias_force(modname_old .. ":panel_" .. subname_old .. alternate, modname_new .. ":panel_" .. subname_new .. alternate)
  28. end
  29. end
  30. function stairsplus:register_panel(modname, subname, recipeitem, fields)
  31. local defs = table.copy(stairsplus.defs["panel"])
  32. for alternate, def in pairs(defs) do
  33. stairsplus.register_single("panel", alternate, def, modname, subname, recipeitem, fields)
  34. end
  35. circular_saw.known_nodes[recipeitem] = {modname, subname}
  36. end