nodes.lua 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. --[[
  2. Map Tools: node definitions
  3. Copyright (c) 2012-2015 Calinou and contributors.
  4. Licensed under the zlib license. See LICENSE.md for more information.
  5. --]]
  6. local S = maptools.intllib
  7. maptools.creative = maptools.config["hide_from_creative_inventory"]
  8. -- Nodes
  9. -- =====
  10. minetest.register_node("maptools:black", {
  11. description = S("Black"),
  12. range = 12,
  13. stack_max = 10000,
  14. tiles = {"black.png"},
  15. drop = "",
  16. post_effect_color = {a=255, r=0, g=0, b=0},
  17. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  18. sounds = default.node_sound_stone_defaults(),
  19. })
  20. minetest.register_node("maptools:white", {
  21. description = S("White"),
  22. range = 12,
  23. stack_max = 10000,
  24. tiles = {"white.png"},
  25. drop = "",
  26. post_effect_color = {a=255, r=128, g=128, b=128},
  27. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  28. sounds = default.node_sound_stone_defaults(),
  29. })
  30. minetest.register_node("maptools:playerclip", {
  31. description = S("Player Clip"),
  32. range = 12,
  33. stack_max = 10000,
  34. inventory_image = "default_steel_block.png^dye_green.png",
  35. drawtype = "airlike",
  36. paramtype = "light",
  37. pointable = false,
  38. sunlight_propagates = true,
  39. drop = "",
  40. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  41. })
  42. minetest.register_node("maptools:fake_walkable", {
  43. description = S("Player Clip"),
  44. drawtype = "nodebox",
  45. range = 12,
  46. stack_max = 10000,
  47. inventory_image = "default_steel_block.png^dye_green.png",
  48. drawtype = "airlike",
  49. paramtype = "light",
  50. pointable = false,
  51. sunlight_propagates = true,
  52. node_box = {
  53. type = "fixed",
  54. fixed = {
  55. {0, 0, 0, 0, 0, 0},
  56. },
  57. },
  58. drop = "",
  59. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  60. })
  61. minetest.register_node("maptools:fullclip", {
  62. description = S("Full Clip"),
  63. range = 12,
  64. stack_max = 10000,
  65. inventory_image = "default_steel_block.png^dye_blue.png",
  66. drawtype = "airlike",
  67. paramtype = "light",
  68. sunlight_propagates = true,
  69. drop = "",
  70. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  71. })
  72. minetest.register_node("maptools:fake_walkable_pointable", {
  73. description = S("Player Clip"),
  74. drawtype = "nodebox",
  75. range = 12,
  76. stack_max = 10000,
  77. inventory_image = "default_steel_block.png^dye_green.png",
  78. drawtype = "airlike",
  79. paramtype = "light",
  80. sunlight_propagates = true,
  81. node_box = {
  82. type = "fixed",
  83. fixed = {
  84. {0, 0, 0, 0, 0, 0},
  85. },
  86. },
  87. drop = "",
  88. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  89. })
  90. minetest.register_node("maptools:ignore_like", {
  91. description = S("Ignore-like"),
  92. range = 12,
  93. stack_max = 10000,
  94. inventory_image = "default_steel_block.png^dye_pink.png",
  95. tiles = {"invisible.png"},
  96. paramtype = "light",
  97. sunlight_propagates = true,
  98. drop = "",
  99. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  100. })
  101. minetest.register_node("maptools:ignore_like_no_clip", {
  102. description = S("Ignore-like (no clip)"),
  103. range = 12,
  104. stack_max = 10000,
  105. inventory_image = "default_steel_block.png^dye_purple.png",
  106. tiles = {"invisible.png"},
  107. paramtype = "light",
  108. walkable = false,
  109. sunlight_propagates = true,
  110. drop = "",
  111. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  112. })
  113. minetest.register_node("maptools:ignore_like_no_point", {
  114. description = S("Ignore-like (no point)"),
  115. range = 12,
  116. stack_max = 10000,
  117. inventory_image = "default_steel_block.png^dye_purple.png",
  118. tiles = {"invisible.png"},
  119. paramtype = "light",
  120. pointable = false,
  121. sunlight_propagates = true,
  122. drop = "",
  123. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  124. })
  125. minetest.register_node("maptools:ignore_like_no_clip_no_point", {
  126. description = S("Ignore-like (no clip, no point)"),
  127. range = 12,
  128. stack_max = 10000,
  129. inventory_image = "default_steel_block.png^dye_pink.png",
  130. tiles = {"invisible.png"},
  131. paramtype = "light",
  132. walkable = false,
  133. pointable = false,
  134. sunlight_propagates = true,
  135. drop = "",
  136. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  137. })
  138. minetest.register_node("maptools:fullclip_face", {
  139. description = S("Full Clip Face"),
  140. range = 12,
  141. stack_max = 10000,
  142. inventory_image = "default_steel_block.png^dye_white.png",
  143. drawtype = "nodebox",
  144. tiles = {"invisible.png"},
  145. paramtype = "light",
  146. paramtype2 = "facedir",
  147. sunlight_propagates = true,
  148. node_box = {
  149. type = "fixed",
  150. fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5},
  151. },
  152. drop = "",
  153. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100},
  154. })
  155. minetest.register_node("maptools:playerclip_bottom", {
  156. description = S("Player Clip Bottom Face"),
  157. range = 12,
  158. stack_max = 10000,
  159. inventory_image = "default_steel_block.png^dye_orange.png",
  160. drawtype = "nodebox",
  161. tiles = {"invisible.png"},
  162. pointable = false,
  163. paramtype = "light",
  164. sunlight_propagates = true,
  165. node_box = {
  166. type = "fixed",
  167. fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5},
  168. },
  169. drop = "",
  170. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100},
  171. })
  172. minetest.register_node("maptools:playerclip_top", {
  173. description = S("Player Clip Top Face"),
  174. range = 12,
  175. stack_max = 10000,
  176. inventory_image = "default_steel_block.png^dye_yellow.png",
  177. drawtype = "nodebox",
  178. tiles = {"invisible.png"},
  179. pointable = false,
  180. paramtype = "light",
  181. sunlight_propagates = true,
  182. node_box = {
  183. type = "fixed",
  184. fixed = {-0.5, 0.4999, -0.5, 0.5, 0.5, 0.5},
  185. },
  186. drop = "",
  187. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100},
  188. })
  189. for pusher_num=1,10,1 do
  190. minetest.register_node("maptools:pusher_" .. pusher_num, {
  191. description = S("Pusher (%s)"):format(pusher_num),
  192. range = 12,
  193. stack_max = 10000,
  194. inventory_image = "default_steel_block.png^default_apple.png",
  195. drawtype = "nodebox",
  196. tiles = {"invisible.png"},
  197. paramtype = "light",
  198. paramtype2 = "facedir",
  199. sunlight_propagates = true,
  200. node_box = {
  201. type = "fixed",
  202. fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5},
  203. },
  204. drop = "",
  205. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, fall_damage_add_percent=-100, bouncy=pusher_num*100},
  206. })
  207. end
  208. minetest.register_node("maptools:lightbulb", {
  209. description = S("Light Bulb"),
  210. range = 12,
  211. stack_max = 10000,
  212. inventory_image = "default_steel_block.png^default_mese_crystal_fragment.png",
  213. drawtype = "airlike",
  214. walkable = false,
  215. pointable = false,
  216. light_source = 14,
  217. paramtype = "light",
  218. sunlight_propagates = true,
  219. drop = "",
  220. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  221. })
  222. minetest.register_node("maptools:nobuild", {
  223. description = S("Build Prevention"),
  224. range = 12,
  225. stack_max = 10000,
  226. inventory_image = "default_steel_block.png^bones_bones.png",
  227. drawtype = "airlike",
  228. walkable = false,
  229. pointable = false,
  230. paramtype = "light",
  231. sunlight_propagates = true,
  232. drop = "",
  233. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  234. })
  235. minetest.register_node("maptools:nointeract", {
  236. description = S("Interact Prevention"),
  237. range = 12,
  238. stack_max = 10000,
  239. inventory_image = "default_steel_block.png^default_scorched_stuff.png",
  240. drawtype = "airlike",
  241. walkable = false,
  242. paramtype = "light",
  243. sunlight_propagates = true,
  244. drop = "",
  245. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  246. })
  247. minetest.register_node("maptools:climb", {
  248. description = S("Climb Block"),
  249. range = 12,
  250. stack_max = 10000,
  251. inventory_image = "default_steel_block.png^default_ladder_wood.png",
  252. drawtype = "airlike",
  253. walkable = false,
  254. climbable = true,
  255. pointable = false,
  256. paramtype = "light",
  257. sunlight_propagates = true,
  258. drop = "",
  259. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  260. })
  261. for damage_num=1,5,1 do
  262. minetest.register_node("maptools:damage_" .. damage_num, {
  263. description = S("Damaging Block (%s)"):format(damage_num),
  264. range = 12,
  265. stack_max = 10000,
  266. inventory_image = "default_steel_block.png^farming_cotton_" .. damage_num .. ".png",
  267. drawtype = "airlike",
  268. walkable = false,
  269. pointable = false,
  270. damage_per_second = damage_num,
  271. paramtype = "light",
  272. sunlight_propagates = true,
  273. drop = "",
  274. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  275. })
  276. end
  277. minetest.register_node("maptools:kill", {
  278. description = S("Kill Block"),
  279. range = 12,
  280. stack_max = 10000,
  281. inventory_image = "default_steel_block.png^dye_black.png",
  282. drawtype = "airlike",
  283. walkable = false,
  284. pointable = false,
  285. damage_per_second = 20,
  286. paramtype = "light",
  287. sunlight_propagates = true,
  288. drop = "",
  289. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  290. })
  291. minetest.register_node("maptools:smoke", {
  292. description = S("Smoke Block"),
  293. range = 12,
  294. stack_max = 10000,
  295. tiles = {"maptools_smoke.png"},
  296. drawtype = "allfaces_optional",
  297. walkable = false,
  298. paramtype = "light",
  299. drop = "",
  300. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  301. post_effect_color = {a=192, r=96, g=96, b=96},
  302. })
  303. minetest.register_node("maptools:ladder", {
  304. description = S("Fake Ladder"),
  305. range = 12,
  306. stack_max = 10000,
  307. drawtype = "signlike",
  308. tiles = {"default_ladder_wood.png"},
  309. inventory_image = "default_ladder_wood.png",
  310. wield_image = "default_ladder_wood.png",
  311. paramtype = "light",
  312. paramtype2 = "wallmounted",
  313. walkable = false,
  314. sunlight_propagates = true,
  315. selection_box = {
  316. type = "wallmounted",
  317. },
  318. drop = "",
  319. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  320. sounds = default.node_sound_wood_defaults(),
  321. })
  322. minetest.register_node("maptools:permanent_fire", {
  323. description = S("Permanent Fire"),
  324. range = 12,
  325. stack_max = 10000,
  326. drawtype = "firelike",
  327. paramtype = "light",
  328. tiles = {{
  329. name="fire_basic_flame_animated.png",
  330. animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
  331. }},
  332. inventory_image = "fire_basic_flame.png",
  333. light_source = 14,
  334. drop = "",
  335. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative, flame_sound = 1},
  336. sunlight_propagates = true,
  337. walkable = false,
  338. pointable = false,
  339. damage_per_second = 4,
  340. on_construct = function(pos)
  341. fireambiance.on_flame_addremove(pos)
  342. particles.add_flame_spawner(pos)
  343. end,
  344. after_destruct = function(pos)
  345. fireambiance.on_flame_addremove(pos)
  346. particles.del_flame_spawner(pos)
  347. end,
  348. })
  349. minetest.register_node("maptools:fake_fire", {
  350. description = S("Fake Fire"),
  351. range = 12,
  352. stack_max = 10000,
  353. drawtype = "firelike",
  354. paramtype = "light",
  355. tiles = {{
  356. name="fire_basic_flame_animated.png",
  357. animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1},
  358. }},
  359. inventory_image = "fire_basic_flame.png",
  360. light_source = 14,
  361. drop = "",
  362. groups = {unbreakable = 1, not_in_creative_inventory = maptools.creative},
  363. sunlight_propagates = true,
  364. walkable = false,
  365. on_construct = function(pos)
  366. fireambiance.on_flame_addremove(pos)
  367. particles.add_flame_spawner(pos)
  368. end,
  369. after_destruct = function(pos)
  370. fireambiance.on_flame_addremove(pos)
  371. particles.del_flame_spawner(pos)
  372. end,
  373. })
  374. minetest.register_node("maptools:igniter", {
  375. drawtype = "airlike",
  376. range = 12,
  377. stack_max = 10000,
  378. inventory_image = "default_steel_block.png^crosshair.png",
  379. description = S("Igniter"),
  380. paramtype = "light",
  381. inventory_image = "fire_basic_flame.png",
  382. drop = "",
  383. groups = {igniter=2, unbreakable = 1, not_in_creative_inventory = maptools.creative},
  384. sunlight_propagates = true,
  385. pointable = false,
  386. walkable = false,
  387. })
  388. minetest.register_node("maptools:superapple", {
  389. description = S("Super Apple"),
  390. range = 12,
  391. stack_max = 10000,
  392. drawtype = "plantlike",
  393. --visual_scale = 1.0,
  394. tiles = {"maptools_superapple.png"},
  395. inventory_image = "maptools_superapple.png",
  396. paramtype = "light",
  397. sunlight_propagates = true,
  398. selection_box = {
  399. type = "fixed",
  400. fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
  401. },
  402. walkable = false,
  403. groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory = maptools.creative},
  404. on_use = minetest.item_eat(20),
  405. sounds = default.node_sound_defaults(),
  406. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  407. })