init.lua 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. spawn = {}
  2. spawn.storage = minetest.get_mod_storage()
  3. dofile(minetest.get_modpath('spawn')..'/news.lua')
  4. dofile(minetest.get_modpath('spawn')..'/rules.lua')
  5. dofile(minetest.get_modpath('spawn')..'/commands.lua')
  6. dofile(minetest.get_modpath('spawn')..'/temp_info.lua')
  7. minetest.register_node('spawn:quartz_pillar', {
  8. description = 'Quartz Pillar',
  9. tiles = {'spawn_quartz_top.png', 'spawn_quartz_top.png','spawn_quartz_side.png'},
  10. paramtype2 = 'facedir',
  11. on_place = minetest.rotate_node,
  12. sounds = default.node_sound_stone_defaults(),
  13. groups = {not_in_creative_inventory=1}
  14. })
  15. minetest.register_node('spawn:quartz_pillar_slab', {
  16. description = 'Quartz Pillar Slab',
  17. drawtype = 'nodebox',
  18. tiles = {'spawn_quartz_top.png', 'spawn_quartz_top.png','spawn_quartz_side.png'},
  19. paramtype2 = 'facedir',
  20. node_box = {
  21. type = 'fixed',
  22. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  23. },
  24. on_place = minetest.rotate_node,
  25. sounds = default.node_sound_stone_defaults(),
  26. groups = {not_in_creative_inventory=1}
  27. })
  28. minetest.register_node('spawn:quartz1_pillar_slab', {
  29. description = 'Quartz Pillar Slab',
  30. drawtype = 'nodebox',
  31. tiles = {{name='spawn_quartz1.png', align_style='world', scale=4}},
  32. paramtype2 = 'facedir',
  33. node_box = {
  34. type = 'fixed',
  35. fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5},
  36. },
  37. on_place = minetest.rotate_node,
  38. sounds = default.node_sound_stone_defaults(),
  39. groups = {not_in_creative_inventory=1}
  40. })
  41. local nodes = { --name, desc,
  42. {'stone', 'Tiled Stone'},
  43. {'basalt', 'Basalt'},
  44. {'quartz1', 'Quartz1'},
  45. {'quartz2', 'Quartz2'},
  46. {'brick', 'Brick'},
  47. {'bridge', 'Bridge'},
  48. {'path', 'Path'},
  49. {'brown_concrete', 'Brown Concrete'},
  50. {'black_concrete', 'Black Concrete'},
  51. }
  52. for i in ipairs (nodes) do
  53. local name = nodes[i][1]
  54. local desc = nodes[i][2]
  55. minetest.register_node('spawn:'..name, {
  56. description = desc,
  57. tiles = {{name='spawn_'..name..'.png', align_style='world', scale=4}},
  58. inventory_image = '[inventorycube{spawn_'..name..'.png&[sheet:4x4:1,1{spawn_'..name..'.png&[sheet:4x4:1,1{spawn_'..name..'.png&[sheet:4x4:1,1',
  59. sounds = default.node_sound_stone_defaults(),
  60. groups = {not_in_creative_inventory=1}
  61. })
  62. end
  63. minetest.register_node('spawn:path', {
  64. description = 'Path',
  65. tiles = {{name='spawn_path.png', align_style='world', scale=4}},
  66. inventory_image = '[inventorycube{spawn_path.png&[sheet:4x4:1,1{spawn_path.png&[sheet:4x4:1,1{spawn_path.png&[sheet:4x4:1,1',
  67. sounds = default.node_sound_stone_defaults(),
  68. groups = {crumbly = 2},
  69. })
  70. minetest.register_craft({
  71. output = 'spawn:path 2',
  72. recipe = {
  73. {'epic:scorched_dirt', 'epic:scorched_dirt'}
  74. }
  75. })
  76. minetest.register_node('spawn:andesite', {
  77. description = 'Andesite',
  78. tiles = {'spawn_andesite.png',},
  79. sounds = default.node_sound_stone_defaults(),
  80. groups = {not_in_creative_inventory=1}
  81. })
  82. ---Mesh Nodes
  83. minetest.register_node('spawn:sign', {
  84. description = 'Exit Sign',
  85. drawtype = 'mesh',
  86. mesh = 'spawn_sign.obj',
  87. tiles = {'spawn_sign.png'},
  88. paramtype = 'light',
  89. paramtype2 = 'facedir',
  90. selection_box = {
  91. type = 'fixed',
  92. fixed = {-.44, -.1, -.1, .44, .5, .1},
  93. },
  94. collision_box = {
  95. type = 'fixed',
  96. fixed = {-.44, -.1, -.1, .44, .5, .1},
  97. },
  98. groups = {oddly_breakable_by_hand = 1, not_in_creative_inventory=1},
  99. })
  100. minetest.register_node('spawn:poster1', {
  101. description = 'Rules Poster',
  102. drawtype = 'mesh',
  103. mesh = 'spawn_poster.obj',
  104. tiles = {'spawn_poster_rules.png'},
  105. paramtype = 'light',
  106. paramtype2 = 'facedir',
  107. groups = {not_in_creative_inventory=1},
  108. selection_box = {
  109. type = 'fixed',
  110. fixed = {-.5, -.5, .4, .5, .5, .5},
  111. },
  112. collision_box = {
  113. type = 'fixed',
  114. fixed = {-.5, -.5, .4, .5, .5, .5},
  115. },
  116. on_rightclick = function(pos)
  117. local meta = minetest.get_meta(pos)
  118. meta:set_string('infotext', 'Rules')
  119. meta:set_string('formspec', spawn_rules_formspec)
  120. end,
  121. })
  122. minetest.register_node('spawn:poster2', {
  123. description = 'News Poster',
  124. drawtype = 'mesh',
  125. mesh = 'spawn_poster.obj',
  126. tiles = {'spawn_poster_news.png'},
  127. paramtype = 'light',
  128. paramtype2 = 'facedir',
  129. groups = {not_in_creative_inventory=1},
  130. selection_box = {
  131. type = 'fixed',
  132. fixed = {-.5, -.5, .4, .5, .5, .5},
  133. },
  134. collision_box = {
  135. type = 'fixed',
  136. fixed = {-.5, -.5, .4, .5, .5, .5},
  137. },
  138. on_rightclick = function(pos)
  139. local meta = minetest.get_meta(pos)
  140. meta:set_string('infotext', 'News')
  141. meta:set_string('formspec', spawn_news_formspec)
  142. end,
  143. })