1
0

init.lua 9.9 KB

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