init.lua 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. local WATER_ALPHA = 160
  2. local WATER_VISC = 1
  3. local LAVA_VISC = 7
  4. --
  5. -- Node definitions
  6. --
  7. -- Register nodes
  8. minetest.register_node("basenodes:stone", {
  9. description = "Stone",
  10. tiles = {"default_stone.png"},
  11. groups = {cracky=3},
  12. })
  13. minetest.register_node("basenodes:desert_stone", {
  14. description = "Desert Stone",
  15. tiles = {"default_desert_stone.png"},
  16. groups = {cracky=3},
  17. })
  18. minetest.register_node("basenodes:dirt_with_grass", {
  19. description = "Dirt with Grass",
  20. tiles ={"default_grass.png",
  21. -- a little dot on the bottom to distinguish it from dirt
  22. "default_dirt.png^basenodes_dirt_with_grass_bottom.png",
  23. {name = "default_dirt.png^default_grass_side.png",
  24. tileable_vertical = false}},
  25. groups = {crumbly=3, soil=1},
  26. })
  27. minetest.register_node("basenodes:dirt_with_snow", {
  28. description = "Dirt with Snow",
  29. tiles ={"basenodes_dirt_with_snow.png",
  30. -- a little dot on the bottom to distinguish it from dirt
  31. "default_dirt.png^basenodes_dirt_with_snow_bottom.png",
  32. {name = "default_dirt.png^default_snow_side.png",
  33. tileable_vertical = false}},
  34. groups = {crumbly=3, soil=1},
  35. })
  36. minetest.register_node("basenodes:dirt", {
  37. description = "Dirt",
  38. tiles ={"default_dirt.png"},
  39. groups = {crumbly=3, soil=1},
  40. })
  41. minetest.register_node("basenodes:sand", {
  42. description = "Sand",
  43. tiles ={"default_sand.png"},
  44. groups = {crumbly=3},
  45. })
  46. minetest.register_node("basenodes:desert_sand", {
  47. description = "Desert Sand",
  48. tiles ={"default_desert_sand.png"},
  49. groups = {crumbly=3},
  50. })
  51. minetest.register_node("basenodes:gravel", {
  52. description = "Gravel",
  53. tiles ={"default_gravel.png"},
  54. groups = {crumbly=2},
  55. })
  56. minetest.register_node("basenodes:junglegrass", {
  57. description = "Jungle Grass",
  58. drawtype = "plantlike",
  59. tiles ={"default_junglegrass.png"},
  60. inventory_image = "default_junglegrass.png",
  61. wield_image = "default_junglegrass.png",
  62. paramtype = "light",
  63. walkable = false,
  64. groups = {snappy=3},
  65. })
  66. minetest.register_node("basenodes:tree", {
  67. description = "Normal Tree Trunk",
  68. tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
  69. is_ground_content = false,
  70. groups = {choppy=2,oddly_breakable_by_hand=1},
  71. })
  72. minetest.register_node("basenodes:leaves", {
  73. description = "Normal Leaves",
  74. drawtype = "allfaces_optional",
  75. tiles = {"default_leaves.png"},
  76. paramtype = "light",
  77. is_ground_content = false,
  78. groups = {snappy=3},
  79. })
  80. minetest.register_node("basenodes:jungletree", {
  81. description = "Jungle Tree Trunk",
  82. tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
  83. is_ground_content = false,
  84. groups = {choppy=2,oddly_breakable_by_hand=1},
  85. })
  86. minetest.register_node("basenodes:jungleleaves", {
  87. description = "Jungle Leaves",
  88. drawtype = "allfaces_optional",
  89. tiles = {"default_jungleleaves.png"},
  90. paramtype = "light",
  91. is_ground_content = false,
  92. groups = {snappy=3},
  93. })
  94. minetest.register_node("basenodes:pine_tree", {
  95. description = "Pine Tree Trunk",
  96. tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png", "default_pine_tree.png"},
  97. is_ground_content = false,
  98. groups = {choppy=2,oddly_breakable_by_hand=1},
  99. })
  100. minetest.register_node("basenodes:pine_needles", {
  101. description = "Pine Needles",
  102. drawtype = "allfaces_optional",
  103. tiles = {"default_pine_needles.png"},
  104. paramtype = "light",
  105. is_ground_content = false,
  106. groups = {snappy=3},
  107. })
  108. minetest.register_node("basenodes:water_source", {
  109. description = "Water Source",
  110. drawtype = "liquid",
  111. tiles = {"default_water.png"},
  112. special_tiles = {
  113. {name = "default_water.png", backface_culling = false},
  114. {name = "default_water.png", backface_culling = true},
  115. },
  116. alpha = WATER_ALPHA,
  117. paramtype = "light",
  118. walkable = false,
  119. pointable = false,
  120. diggable = false,
  121. buildable_to = true,
  122. is_ground_content = false,
  123. drowning = 1,
  124. liquidtype = "source",
  125. liquid_alternative_flowing = "basenodes:water_flowing",
  126. liquid_alternative_source = "basenodes:water_source",
  127. liquid_viscosity = WATER_VISC,
  128. post_effect_color = {a = 64, r = 100, g = 100, b = 200},
  129. groups = {water = 3, liquid = 3},
  130. })
  131. minetest.register_node("basenodes:water_flowing", {
  132. description = "Flowing Water",
  133. drawtype = "flowingliquid",
  134. tiles = {"default_water_flowing.png"},
  135. special_tiles = {
  136. {name = "default_water_flowing.png", backface_culling = false},
  137. {name = "default_water_flowing.png", backface_culling = false},
  138. },
  139. alpha = WATER_ALPHA,
  140. paramtype = "light",
  141. paramtype2 = "flowingliquid",
  142. walkable = false,
  143. pointable = false,
  144. diggable = false,
  145. buildable_to = true,
  146. is_ground_content = false,
  147. drowning = 1,
  148. liquidtype = "flowing",
  149. liquid_alternative_flowing = "basenodes:water_flowing",
  150. liquid_alternative_source = "basenodes:water_source",
  151. liquid_viscosity = WATER_VISC,
  152. post_effect_color = {a = 64, r = 100, g = 100, b = 200},
  153. groups = {water = 3, liquid = 3},
  154. })
  155. minetest.register_node("basenodes:river_water_source", {
  156. description = "River Water Source",
  157. drawtype = "liquid",
  158. tiles = { "default_river_water.png" },
  159. special_tiles = {
  160. {name = "default_river_water.png", backface_culling = false},
  161. {name = "default_river_water.png", backface_culling = true},
  162. },
  163. alpha = WATER_ALPHA,
  164. paramtype = "light",
  165. walkable = false,
  166. pointable = false,
  167. diggable = false,
  168. buildable_to = true,
  169. is_ground_content = false,
  170. drowning = 1,
  171. liquidtype = "source",
  172. liquid_alternative_flowing = "basenodes:river_water_flowing",
  173. liquid_alternative_source = "basenodes:river_water_source",
  174. liquid_viscosity = 1,
  175. liquid_renewable = false,
  176. liquid_range = 2,
  177. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  178. groups = {water = 3, liquid = 3, },
  179. })
  180. minetest.register_node("basenodes:river_water_flowing", {
  181. description = "Flowing River Water",
  182. drawtype = "flowingliquid",
  183. tiles = {"default_river_water_flowing.png"},
  184. special_tiles = {
  185. {name = "default_river_water_flowing.png", backface_culling = false},
  186. {name = "default_river_water_flowing.png", backface_culling = false},
  187. },
  188. alpha = WATER_ALPHA,
  189. paramtype = "light",
  190. paramtype2 = "flowingliquid",
  191. walkable = false,
  192. pointable = false,
  193. diggable = false,
  194. buildable_to = true,
  195. is_ground_content = false,
  196. drowning = 1,
  197. liquidtype = "flowing",
  198. liquid_alternative_flowing = "basenodes:river_water_flowing",
  199. liquid_alternative_source = "basenodes:river_water_source",
  200. liquid_viscosity = 1,
  201. liquid_renewable = false,
  202. liquid_range = 2,
  203. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  204. groups = {water = 3, liquid = 3, },
  205. })
  206. minetest.register_node("basenodes:lava_flowing", {
  207. description = "Flowing Lava",
  208. drawtype = "flowingliquid",
  209. tiles = {"default_lava_flowing.png"},
  210. special_tiles = {
  211. {name="default_lava_flowing.png", backface_culling = false},
  212. {name="default_lava_flowing.png", backface_culling = false},
  213. },
  214. paramtype = "light",
  215. light_source = minetest.LIGHT_MAX,
  216. walkable = false,
  217. pointable = false,
  218. diggable = false,
  219. buildable_to = true,
  220. is_ground_content = false,
  221. drowning = 1,
  222. damage_per_second = 4,
  223. liquidtype = "flowing",
  224. liquid_alternative_flowing = "basenodes:lava_flowing",
  225. liquid_alternative_source = "basenodes:lava_source",
  226. liquid_viscosity = LAVA_VISC,
  227. post_effect_color = {a=192, r=255, g=64, b=0},
  228. groups = {lava=3, liquid=1},
  229. })
  230. minetest.register_node("basenodes:lava_source", {
  231. description = "Lava Source",
  232. drawtype = "liquid",
  233. tiles = { "default_lava.png" },
  234. special_tiles = {
  235. {name = "default_lava.png", backface_culling = false},
  236. {name = "default_lava.png", backface_culling = true},
  237. },
  238. paramtype = "light",
  239. light_source = minetest.LIGHT_MAX,
  240. walkable = false,
  241. pointable = false,
  242. diggable = false,
  243. buildable_to = true,
  244. is_ground_content = false,
  245. drowning = 1,
  246. damage_per_second = 4,
  247. liquidtype = "source",
  248. liquid_alternative_flowing = "basenodes:lava_flowing",
  249. liquid_alternative_source = "basenodes:lava_source",
  250. liquid_viscosity = LAVA_VISC,
  251. post_effect_color = {a=192, r=255, g=64, b=0},
  252. groups = {lava=3, liquid=1},
  253. })
  254. minetest.register_node("basenodes:cobble", {
  255. description = "Cobblestone",
  256. tiles ={"default_cobble.png"},
  257. is_ground_content = false,
  258. groups = {cracky=3},
  259. })
  260. minetest.register_node("basenodes:mossycobble", {
  261. description = "Mossy Cobblestone",
  262. tiles ={"default_mossycobble.png"},
  263. is_ground_content = false,
  264. groups = {cracky=3},
  265. })
  266. minetest.register_node("basenodes:apple", {
  267. description = "Apple",
  268. drawtype = "plantlike",
  269. tiles ={"default_apple.png"},
  270. inventory_image = "default_apple.png",
  271. paramtype = "light",
  272. is_ground_content = false,
  273. sunlight_propagates = true,
  274. walkable = false,
  275. groups = {dig_immediate=3},
  276. -- Make eatable because why not?
  277. on_use = minetest.item_eat(2),
  278. })
  279. minetest.register_node("basenodes:ice", {
  280. description = "Ice",
  281. tiles ={"default_ice.png"},
  282. groups = {cracky=3},
  283. })
  284. -- The snow nodes intentionally have different tints to make them more
  285. -- distinguishable
  286. minetest.register_node("basenodes:snow", {
  287. description = "Snow Sheet",
  288. tiles = {"basenodes_snow_sheet.png"},
  289. groups = {crumbly=3},
  290. walkable = false,
  291. paramtype = "light",
  292. drawtype = "nodebox",
  293. node_box = {
  294. type = "fixed",
  295. fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  296. },
  297. })
  298. minetest.register_node("basenodes:snowblock", {
  299. description = "Snow Block",
  300. tiles ={"default_snow.png"},
  301. groups = {crumbly=3},
  302. })