init.lua 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. local WATER_ALPHA = "^[opacity:" .. 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".."\n"..
  110. "Drowning damage: 1",
  111. drawtype = "liquid",
  112. waving = 3,
  113. tiles = {"default_water.png"..WATER_ALPHA},
  114. special_tiles = {
  115. {name = "default_water.png"..WATER_ALPHA, backface_culling = false},
  116. {name = "default_water.png"..WATER_ALPHA, backface_culling = true},
  117. },
  118. use_texture_alpha = "blend",
  119. paramtype = "light",
  120. walkable = false,
  121. pointable = false,
  122. diggable = false,
  123. buildable_to = true,
  124. is_ground_content = false,
  125. drowning = 1,
  126. liquidtype = "source",
  127. liquid_alternative_flowing = "basenodes:water_flowing",
  128. liquid_alternative_source = "basenodes:water_source",
  129. liquid_viscosity = WATER_VISC,
  130. post_effect_color = {a = 64, r = 100, g = 100, b = 200},
  131. groups = {water = 3, liquid = 3},
  132. })
  133. minetest.register_node("basenodes:water_flowing", {
  134. description = "Flowing Water".."\n"..
  135. "Drowning damage: 1",
  136. drawtype = "flowingliquid",
  137. waving = 3,
  138. tiles = {"default_water_flowing.png"},
  139. special_tiles = {
  140. {name = "default_water_flowing.png"..WATER_ALPHA,
  141. backface_culling = false},
  142. {name = "default_water_flowing.png"..WATER_ALPHA,
  143. backface_culling = false},
  144. },
  145. use_texture_alpha = "blend",
  146. paramtype = "light",
  147. paramtype2 = "flowingliquid",
  148. walkable = false,
  149. pointable = false,
  150. diggable = false,
  151. buildable_to = true,
  152. is_ground_content = false,
  153. drowning = 1,
  154. liquidtype = "flowing",
  155. liquid_alternative_flowing = "basenodes:water_flowing",
  156. liquid_alternative_source = "basenodes:water_source",
  157. liquid_viscosity = WATER_VISC,
  158. post_effect_color = {a = 64, r = 100, g = 100, b = 200},
  159. groups = {water = 3, liquid = 3},
  160. })
  161. minetest.register_node("basenodes:river_water_source", {
  162. description = "River Water Source".."\n"..
  163. "Drowning damage: 1",
  164. drawtype = "liquid",
  165. waving = 3,
  166. tiles = { "default_river_water.png"..WATER_ALPHA },
  167. special_tiles = {
  168. {name = "default_river_water.png"..WATER_ALPHA, backface_culling = false},
  169. {name = "default_river_water.png"..WATER_ALPHA, backface_culling = true},
  170. },
  171. use_texture_alpha = "blend",
  172. paramtype = "light",
  173. walkable = false,
  174. pointable = false,
  175. diggable = false,
  176. buildable_to = true,
  177. is_ground_content = false,
  178. drowning = 1,
  179. liquidtype = "source",
  180. liquid_alternative_flowing = "basenodes:river_water_flowing",
  181. liquid_alternative_source = "basenodes:river_water_source",
  182. liquid_viscosity = 1,
  183. liquid_renewable = false,
  184. liquid_range = 2,
  185. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  186. groups = {water = 3, liquid = 3, },
  187. })
  188. minetest.register_node("basenodes:river_water_flowing", {
  189. description = "Flowing River Water".."\n"..
  190. "Drowning damage: 1",
  191. drawtype = "flowingliquid",
  192. waving = 3,
  193. tiles = {"default_river_water_flowing.png"..WATER_ALPHA},
  194. special_tiles = {
  195. {name = "default_river_water_flowing.png"..WATER_ALPHA,
  196. backface_culling = false},
  197. {name = "default_river_water_flowing.png"..WATER_ALPHA,
  198. backface_culling = false},
  199. },
  200. use_texture_alpha = "blend",
  201. paramtype = "light",
  202. paramtype2 = "flowingliquid",
  203. walkable = false,
  204. pointable = false,
  205. diggable = false,
  206. buildable_to = true,
  207. is_ground_content = false,
  208. drowning = 1,
  209. liquidtype = "flowing",
  210. liquid_alternative_flowing = "basenodes:river_water_flowing",
  211. liquid_alternative_source = "basenodes:river_water_source",
  212. liquid_viscosity = 1,
  213. liquid_renewable = false,
  214. liquid_range = 2,
  215. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  216. groups = {water = 3, liquid = 3, },
  217. })
  218. minetest.register_node("basenodes:lava_flowing", {
  219. description = "Flowing Lava".."\n"..
  220. "4 damage per second".."\n"..
  221. "Drowning damage: 1",
  222. drawtype = "flowingliquid",
  223. tiles = {"default_lava_flowing.png"},
  224. special_tiles = {
  225. {name="default_lava_flowing.png", backface_culling = false},
  226. {name="default_lava_flowing.png", backface_culling = false},
  227. },
  228. paramtype = "light",
  229. light_source = minetest.LIGHT_MAX,
  230. walkable = false,
  231. pointable = false,
  232. diggable = false,
  233. buildable_to = true,
  234. is_ground_content = false,
  235. drowning = 1,
  236. damage_per_second = 4,
  237. liquidtype = "flowing",
  238. liquid_alternative_flowing = "basenodes:lava_flowing",
  239. liquid_alternative_source = "basenodes:lava_source",
  240. liquid_viscosity = LAVA_VISC,
  241. post_effect_color = {a=192, r=255, g=64, b=0},
  242. groups = {lava=3, liquid=1},
  243. })
  244. minetest.register_node("basenodes:lava_source", {
  245. description = "Lava Source".."\n"..
  246. "4 damage per second".."\n"..
  247. "Drowning damage: 1",
  248. drawtype = "liquid",
  249. tiles = { "default_lava.png" },
  250. special_tiles = {
  251. {name = "default_lava.png", backface_culling = false},
  252. {name = "default_lava.png", backface_culling = true},
  253. },
  254. paramtype = "light",
  255. light_source = minetest.LIGHT_MAX,
  256. walkable = false,
  257. pointable = false,
  258. diggable = false,
  259. buildable_to = true,
  260. is_ground_content = false,
  261. drowning = 1,
  262. damage_per_second = 4,
  263. liquidtype = "source",
  264. liquid_alternative_flowing = "basenodes:lava_flowing",
  265. liquid_alternative_source = "basenodes:lava_source",
  266. liquid_viscosity = LAVA_VISC,
  267. post_effect_color = {a=192, r=255, g=64, b=0},
  268. groups = {lava=3, liquid=1},
  269. })
  270. minetest.register_node("basenodes:cobble", {
  271. description = "Cobblestone",
  272. tiles ={"default_cobble.png"},
  273. is_ground_content = false,
  274. groups = {cracky=3},
  275. })
  276. minetest.register_node("basenodes:mossycobble", {
  277. description = "Mossy Cobblestone",
  278. tiles ={"default_mossycobble.png"},
  279. is_ground_content = false,
  280. groups = {cracky=3},
  281. })
  282. minetest.register_node("basenodes:apple", {
  283. description = "Apple".."\n"..
  284. "Food (+2)",
  285. drawtype = "plantlike",
  286. tiles ={"default_apple.png"},
  287. inventory_image = "default_apple.png",
  288. paramtype = "light",
  289. is_ground_content = false,
  290. sunlight_propagates = true,
  291. walkable = false,
  292. groups = {dig_immediate=3},
  293. -- Make eatable because why not?
  294. on_use = minetest.item_eat(2),
  295. })
  296. minetest.register_node("basenodes:ice", {
  297. description = "Ice",
  298. tiles ={"default_ice.png"},
  299. groups = {cracky=3},
  300. })
  301. -- The snow nodes intentionally have different tints to make them more
  302. -- distinguishable
  303. minetest.register_node("basenodes:snow", {
  304. description = "Snow Sheet",
  305. tiles = {"basenodes_snow_sheet.png"},
  306. groups = {crumbly=3},
  307. walkable = false,
  308. paramtype = "light",
  309. drawtype = "nodebox",
  310. node_box = {
  311. type = "fixed",
  312. fixed = {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  313. },
  314. })
  315. minetest.register_node("basenodes:snowblock", {
  316. description = "Snow Block",
  317. tiles ={"default_snow.png"},
  318. groups = {crumbly=3},
  319. })