micro.lua 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. -- Node will be called <modname>micro_<subname>
  2. function stairsplus.register_micro(modname, subname, recipeitem, groups, images, description, drop, sounds, sunlight)
  3. --
  4. -- nodes
  5. --
  6. minetest.register_node(":".. modname .. ":micro_" .. subname .. "_bottom", {
  7. description = description,
  8. drawtype = "nodebox",
  9. tiles = images,
  10. paramtype = "light",
  11. paramtype2 = "facedir",
  12. is_ground_content = false,
  13. sunlight_propagates = sunlight,
  14. groups = groups,
  15. drop = modname .. ":micro_" .. drop .. "_bottom",
  16. node_box = {
  17. type = "fixed",
  18. fixed = {-0.5, -0.5, 0, 0, 0, 0.5},
  19. },
  20. sounds = sounds,
  21. })
  22. minetest.register_node(":".. modname .. ":micro_" .. subname .. "_top", {
  23. description = description,
  24. drawtype = "nodebox",
  25. tiles = images,
  26. paramtype = "light",
  27. paramtype2 = "facedir",
  28. is_ground_content = false,
  29. sunlight_propagates = sunlight,
  30. groups = groups,
  31. drop = modname .. ":micro_" .. drop .. "_top",
  32. node_box = {
  33. type = "fixed",
  34. fixed = {-0.5, 0, 0, 0, 0.5, 0.5},
  35. },
  36. sounds = sounds,
  37. })
  38. --
  39. -- crafting
  40. --
  41. minetest.register_craft({
  42. output = modname .. ":micro_" .. subname .. "_bottom 8",
  43. recipe = {
  44. {"default:stick"},
  45. {recipeitem},
  46. },
  47. })
  48. minetest.register_craft({
  49. output = modname .. ":micro_" .. subname .. "_top 1",
  50. recipe = {
  51. {modname .. ":micro_" .. subname .. "_bottom"},
  52. },
  53. })
  54. minetest.register_craft({
  55. output = modname .. ":micro_" .. subname .. "_bottom 1",
  56. recipe = {
  57. {modname .. ":micro_" .. subname .. "_top"},
  58. },
  59. })
  60. minetest.register_craft({
  61. output = recipeitem,
  62. recipe = {
  63. {modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname .. "_bottom"},
  64. {modname .. ":micro_" .. subname .. "_bottom", "", modname .. ":micro_" .. subname .. "_bottom"},
  65. {modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname .. "_bottom", modname .. ":micro_" .. subname .. "_bottom"},
  66. },
  67. })
  68. minetest.register_craft({
  69. output = recipeitem,
  70. recipe = {
  71. {modname .. ":micro_" .. subname .. "_top", modname .. ":micro_" .. subname .. "_top", modname .. ":micro_" .. subname .. "_top"},
  72. {modname .. ":micro_" .. subname .. "_top", "", modname .. ":micro_" .. subname .. "_top"},
  73. {modname .. ":micro_" .. subname .. "_top", modname .. ":micro_" .. subname .. "_top", modname .. ":micro_" .. subname .. "_top"},
  74. },
  75. })
  76. --
  77. -- cooking
  78. --
  79. minetest.register_craft({
  80. type = "cooking",
  81. output = modname .. ":micro_stone_bottom",
  82. recipe = modname .. ":micro_cobble_bottom",
  83. })
  84. minetest.register_craft({
  85. type = "cooking",
  86. output = modname .. ":micro_stone_top",
  87. recipe = modname .. ":micro_cobble_top",
  88. })
  89. end