ithildin.lua 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. minetest.register_node("lottores:ithildin_0", {
  2. description = "Ithildin",
  3. tiles = {"ithildin_0.png"},
  4. drawtype = "glasslike",
  5. paramtype = "light",
  6. walkable = false,
  7. pointable = false,
  8. sunlight_propagates = true,
  9. drop = "lottores:ithildin_1",
  10. groups = {snappy=2,cracky=3, not_in_creative_inventory=1},
  11. sounds = default.node_sound_glass_defaults(),
  12. })
  13. minetest.register_node("lottores:ithildin_1", {
  14. description = "Ithildin",
  15. tiles = {"ithildin_1.png"},
  16. paramtype = "light",
  17. drawtype = 'glasslike',
  18. walkable = false,
  19. pointable = true,
  20. sunlight_propagates = true,
  21. light_source = 8,
  22. drop = "lottores:ithildin_1",
  23. groups = {snappy=2,cracky=3,forbidden=1},
  24. sounds = default.node_sound_glass_defaults(),
  25. })
  26. minetest.register_node("lottores:ithildin_stone_0", {
  27. description = "Ithildin Stone",
  28. tiles = {"default_stone.png"},
  29. drawtype = 'normal',
  30. walkable = true,
  31. pointable = true,
  32. sunlight_propagates = false,
  33. drop = "lottores:ithildin_stone_1",
  34. groups = {snappy=2,cracky=3, not_in_creative_inventory=1},
  35. sounds = default.node_sound_glass_defaults(),
  36. })
  37. minetest.register_node("lottores:ithildin_stone_1", {
  38. description = "Ithildin Stone",
  39. tiles = {"default_stone.png^ithildin_1.png"},
  40. drawtype = 'glasslike',
  41. walkable = false,
  42. pointable = true,
  43. sunlight_propagates = false,
  44. light_source = 8,
  45. drop = "lottores:ithildin_stone_1",
  46. groups = {snappy=2,cracky=3,forbidden=1},
  47. sounds = default.node_sound_glass_defaults(),
  48. })
  49. minetest.register_node("lottores:ithildin_stonelamp_0", {
  50. description = "Ithildin Stonelamp",
  51. tiles = {"default_stone.png"},
  52. drawtype = 'normal',
  53. walkable = true,
  54. pointable = true,
  55. sunlight_propagates = false,
  56. drop = "lottores:ithildin_stonelamp_1",
  57. groups = {snappy=2,cracky=3, not_in_creative_inventory=1},
  58. sounds = default.node_sound_glass_defaults(),
  59. })
  60. minetest.register_node("lottores:ithildin_stonelamp_1", {
  61. description = "Ithildin Stonelamp",
  62. tiles = {"default_stone.png^ithildin_lamp_1.png"},
  63. drawtype = 'normal',
  64. walkable = true,
  65. pointable = true,
  66. sunlight_propagates = false,
  67. light_source = 8,
  68. drop = "lottores:ithildin_stonelamp_1",
  69. groups = {snappy=2,cracky=3,forbidden=1},
  70. sounds = default.node_sound_glass_defaults(),
  71. })
  72. minetest.register_node("lottores:ithildin_lamp_0", {
  73. description = "Ithildin Lamp",
  74. tiles = {"ithildin_lamp_0.png"},
  75. paramtype = "light",
  76. drawtype = 'glasslike',
  77. walkable = false,
  78. pointable = false,
  79. sunlight_propagates = true,
  80. drop = "lottores:ithildin_lamp_1",
  81. groups = {snappy=2,cracky=3, not_in_creative_inventory=1},
  82. sounds = default.node_sound_glass_defaults(),
  83. })
  84. minetest.register_node("lottores:ithildin_lamp_1", {
  85. description = "Ithildin Lamp",
  86. tiles = {"ithildin_lamp_1.png"},
  87. paramtype = "light",
  88. drawtype = 'glasslike',
  89. walkable = true,
  90. pointable = true,
  91. sunlight_propagates = true,
  92. light_source = 8,
  93. drop = "lottores:ithildin_lamp_1",
  94. groups = {snappy=2,cracky=3,forbidden=1},
  95. sounds = default.node_sound_glass_defaults(),
  96. })
  97. -- ABMs
  98. minetest.register_abm(
  99. {nodenames = {"lottores:ithildin_1"},
  100. interval = 1,
  101. chance = 1,
  102. action = function(pos, node, active_object_count, active_object_count_wider)
  103. if minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.8
  104. then
  105. minetest.set_node(pos, {name="lottores:ithildin_0"})
  106. end
  107. end,
  108. })
  109. minetest.register_abm(
  110. {nodenames = {"lottores:ithildin_0"},
  111. interval = 1,
  112. chance = 1,
  113. action = function(pos, node, active_object_count, active_object_count_wider)
  114. if minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.8
  115. then
  116. minetest.set_node(pos, {name="lottores:ithildin_1"})
  117. end
  118. end,
  119. })
  120. minetest.register_abm(
  121. {nodenames = {"lottores:ithildin_stone_1"},
  122. interval = 1,
  123. chance = 1,
  124. action = function(pos, node, active_object_count, active_object_count_wider)
  125. if minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.8
  126. then
  127. minetest.set_node(pos, {name="lottores:ithildin_stone_0"})
  128. end
  129. end,
  130. })
  131. minetest.register_abm(
  132. {nodenames = {"lottores:ithildin_stone_0"},
  133. interval = 1,
  134. chance = 1,
  135. action = function(pos, node, active_object_count, active_object_count_wider)
  136. if minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.8
  137. then
  138. minetest.set_node(pos, {name="lottores:ithildin_stone_1"})
  139. end
  140. end,
  141. })
  142. minetest.register_abm(
  143. {nodenames = {"lottores:ithildin_stonelamp_1"},
  144. interval = 1,
  145. chance = 1,
  146. action = function(pos, node, active_object_count, active_object_count_wider)
  147. if minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.8
  148. then
  149. minetest.set_node(pos, {name="lottores:ithildin_stonelamp_0"})
  150. end
  151. end,
  152. })
  153. minetest.register_abm(
  154. {nodenames = {"lottores:ithildin_stonelamp_0"},
  155. interval = 1,
  156. chance = 1,
  157. action = function(pos, node, active_object_count, active_object_count_wider)
  158. if minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.8
  159. then
  160. minetest.set_node(pos, {name="lottores:ithildin_stonelamp_1"})
  161. end
  162. end,
  163. })
  164. minetest.register_abm(
  165. {nodenames = {"lottores:ithildin_lamp_1"},
  166. interval = 1,
  167. chance = 1,
  168. action = function(pos, node, active_object_count, active_object_count_wider)
  169. if minetest.get_timeofday() > 0.2 and minetest.get_timeofday() < 0.8
  170. then
  171. minetest.set_node(pos, {name="lottores:ithildin_lamp_0"})
  172. end
  173. end,
  174. })
  175. minetest.register_abm(
  176. {nodenames = {"lottores:ithildin_lamp_0"},
  177. interval = 1,
  178. chance = 1,
  179. action = function(pos, node, active_object_count, active_object_count_wider)
  180. if minetest.get_timeofday() < 0.2 or minetest.get_timeofday() > 0.8
  181. then
  182. minetest.set_node(pos, {name="lottores:ithildin_lamp_1"})
  183. end
  184. end,
  185. })