custom.lua 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. --[[
  2. More Blocks: microblock definitions
  3. Copyright © 2011-2020 Hugo Locurcio and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. --[[
  7. Subset table should have the following format: (You can remove entries as needed.)
  8. local subset = {
  9. { "micro", "" },
  10. { "micro", "_1" },
  11. { "micro", "_2" },
  12. { "micro", "_4" },
  13. { "micro", "_12" },
  14. { "micro", "_14" },
  15. { "micro", "_15" },
  16. { "panel", "" },
  17. { "panel", "_1" },
  18. { "panel", "_2" },
  19. { "panel", "_4" },
  20. { "panel", "_12" },
  21. { "panel", "_14" },
  22. { "panel", "_15" },
  23. { "slab", "" },
  24. { "slab", "_quarter" },
  25. { "slab", "_three_quarter" },
  26. { "slab", "_1" },
  27. { "slab", "_2" },
  28. { "slab", "_14" },
  29. { "slab", "_15" },
  30. { "slab", "_two_sides" },
  31. { "slab", "_three_sides" },
  32. { "slab", "_three_sides_u" },
  33. { "slope", "" },
  34. { "slope", "_half" },
  35. { "slope", "_half_raised" },
  36. { "slope", "_inner" },
  37. { "slope", "_inner_half" },
  38. { "slope", "_inner_half_raised" },
  39. { "slope", "_inner_cut" },
  40. { "slope", "_inner_cut_half" },
  41. { "slope", "_inner_cut_half_raised" },
  42. { "slope", "_outer" },
  43. { "slope", "_outer_half" },
  44. { "slope", "_outer_half_raised" },
  45. { "slope", "_outer_cut" },
  46. { "slope", "_outer_cut_half" },
  47. { "slope", "_outer_cut_half_raised" },
  48. { "slope", "_cut" },
  49. { "stair", "" },
  50. { "stair", "_half" },
  51. { "stair", "_right_half" },
  52. { "stair", "_inner" },
  53. { "stair", "_outer" },
  54. { "stair", "_alt" },
  55. { "stair", "_alt_1" },
  56. { "stair", "_alt_2" },
  57. { "stair", "_alt_4" },
  58. }
  59. --]]
  60. -- luacheck: no unused
  61. local function register_custom_subset(subset, modname, subname, recipeitem, groups, images, description, drop, light)
  62. stairsplus:register_custom_subset(subset, modname, subname, recipeitem, {
  63. groups = groups,
  64. tiles = images,
  65. description = description,
  66. drop = drop,
  67. light_source = light,
  68. sounds = default.node_sound_stone_defaults(),
  69. })
  70. end
  71. function stairsplus:register_custom_subset_alias(subset, modname_old, subname_old, modname_new, subname_new)
  72. local subset_copy = table.copy(subset)
  73. for k, v in pairs(subset_copy) do
  74. minetest.register_alias(modname_old .. ":" .. v[1] .. "_" .. subname_old .. v[2], modname_new .. ":" .. v[1] .. "_" .. subname_new .. v[2])
  75. end
  76. end
  77. function stairsplus:register_custom_subset_alias_force(subset, modname_old, subname_old, modname_new, subname_new)
  78. local subset_copy = table.copy(subset)
  79. for k, v in pairs(subset_copy) do
  80. minetest.register_alias_force(modname_old .. ":" .. v[1] .. "_" .. subname_old .. v[2], modname_new .. ":" .. v[1] .. "_" .. subname_new .. v[2])
  81. end
  82. end
  83. function stairsplus:register_custom_subset(subset, modname, subname, recipeitem, fields)
  84. local subset_copy = table.copy(subset)
  85. for k, v in pairs(subset_copy) do
  86. stairsplus.register_single(v[1], v[2], stairsplus.defs[v[1]][v[2]], modname, subname, recipeitem, fields)
  87. end
  88. circular_saw.known_nodes[recipeitem] = {modname, subname}
  89. end