nodes.lua 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702
  1. -- mods/default/nodes.lua
  2. --[[ Node name convention:
  3. Although many node names are in combined-word form, the required form for new
  4. node names is words separated by underscores. If both forms are used in written
  5. language (for example pinewood and pine wood) the underscore form should be used.
  6. --]]
  7. --[[ Index:
  8. Stone
  9. -----
  10. (1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
  11. default:stone
  12. default:cobble
  13. default:stonebrick
  14. default:stone_block
  15. default:mossycobble
  16. default:desert_stone
  17. default:desert_cobble
  18. default:desert_stonebrick
  19. default:desert_stone_block
  20. default:sandstone
  21. default:sandstonebrick
  22. default:sandstone_block
  23. default:obsidian
  24. default:obsidianbrick
  25. default:obsidian_block
  26. Soft / Non-Stone
  27. ----------------
  28. (1. Material 2. Modified forms)
  29. default:dirt
  30. default:dirt_with_grass
  31. default:dirt_with_grass_footsteps
  32. default:dirt_with_dry_grass
  33. default:dirt_with_snow
  34. default:sand
  35. default:desert_sand
  36. default:gravel
  37. default:clay
  38. default:snow
  39. default:snowblock
  40. default:ice
  41. Trees
  42. -----
  43. (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
  44. default:tree
  45. default:wood
  46. default:leaves
  47. default:sapling
  48. default:apple
  49. default:jungletree
  50. default:junglewood
  51. default:jungleleaves
  52. default:junglesapling
  53. default:pine_tree
  54. default:pine_wood
  55. default:pine_needles
  56. default:pine_sapling
  57. default:acacia_tree
  58. default:acacia_wood
  59. default:acacia_leaves
  60. default:acacia_sapling
  61. default:aspen_tree
  62. default:aspen_wood
  63. default:aspen_leaves
  64. default:aspen_sapling
  65. Ores
  66. ----
  67. (1. In stone 2. Blocks)
  68. default:stone_with_coal
  69. default:coalblock
  70. default:stone_with_iron
  71. default:steelblock
  72. default:stone_with_copper
  73. default:copperblock
  74. default:bronzeblock
  75. default:stone_with_gold
  76. default:goldblock
  77. default:stone_with_mese
  78. default:mese
  79. default:stone_with_diamond
  80. default:diamondblock
  81. Plantlife (non-cubic)
  82. ---------------------
  83. default:cactus
  84. default:papyrus
  85. default:dry_shrub
  86. default:junglegrass
  87. default:grass_1
  88. default:grass_2
  89. default:grass_3
  90. default:grass_4
  91. default:grass_5
  92. default:dry_grass_1
  93. default:dry_grass_2
  94. default:dry_grass_3
  95. default:dry_grass_4
  96. default:dry_grass_5
  97. Liquids
  98. -------
  99. (1. Source 2. Flowing)
  100. default:water_source
  101. default:water_flowing
  102. default:river_water_source
  103. default:river_water_flowing
  104. default:lava_source
  105. default:lava_flowing
  106. Tools / "Advanced" crafting / Non-"natural"
  107. -------------------------------------------
  108. default:sign_wall_wood
  109. default:sign_wall_steel
  110. default:ladder_wood
  111. default:ladder_steel
  112. default:fence_wood
  113. default:fence_acacia_wood
  114. default:fence_junglewood
  115. default:fence_pine_wood
  116. default:fence_aspen_wood
  117. default:glass
  118. default:obsidian_glass
  119. default:rail
  120. default:brick
  121. default:meselamp
  122. Misc
  123. ----
  124. default:cloud
  125. --]]
  126. --
  127. -- Stone
  128. --
  129. -- Localize for performance.
  130. local math_random = math.random
  131. local vector_add = vector.add
  132. minetest.register_node("default:stone", {
  133. description = "Stone",
  134. --[[
  135. drawtype = "airlike",
  136. paramtype = "light",
  137. sunlight_propagates = true,
  138. light_source = 15,
  139. pointable = false,
  140. --]]
  141. tiles = {{name="stone_macro.png", align_style="world", scale=8}},
  142. groups = utility.dig_groups("stone", {
  143. stone = 1, native_stone = 1,
  144. melts = 1, cobble_type = 1,
  145. }),
  146. drop = 'default:cobble',
  147. legacy_mineral = true,
  148. sounds = default.node_sound_stone_defaults(),
  149. _melts_to = "cavestuff:cobble_with_rockmelt",
  150. _is_bulk_mapgen_stone = true,
  151. -- Common stone does not count toward tool's dig count.
  152. _toolranks = {
  153. ignore = true,
  154. },
  155. -- Collapsed stone breaks up into cobble.
  156. on_finish_collapse = function(pos, node)
  157. minetest.swap_node(pos, {name="default:cobble"})
  158. end,
  159. on_collapse_to_entity = function(pos, node)
  160. minetest.add_item(pos, {name="default:cobble"})
  161. end,
  162. })
  163. -- Name is very similar to default:stone to make it hard to detect even with F5 debug info.
  164. minetest.register_node(":defauIt:stone", {
  165. description = "Stone (Please Report To Admin)",
  166. tiles = {"default_stone.png"},
  167. groups = utility.dig_groups("softcobble", {
  168. melts = 1, falling_node = 1,
  169. }),
  170. drop = 'default:cobble',
  171. legacy_mineral = true,
  172. sounds = default.node_sound_stone_defaults(),
  173. _melts_to = "cavestuff:cobble_with_rockmelt",
  174. _is_bulk_mapgen_stone = true,
  175. -- Common stone does not count toward tool's dig count.
  176. _toolranks = {
  177. ignore = true,
  178. },
  179. -- Collapsed stone breaks up into cobble.
  180. on_finish_collapse = function(pos, node)
  181. minetest.swap_node(pos, {name="default:cobble"})
  182. end,
  183. on_collapse_to_entity = function(pos, node)
  184. minetest.add_item(pos, {name="default:cobble"})
  185. end,
  186. -- Player walking on it causes collapse.
  187. on_player_walk_over = function(pos, player)
  188. minetest.check_for_falling(pos)
  189. end,
  190. })
  191. minetest.register_node("default:cobble", {
  192. description = "Cobblestone",
  193. tiles = {"default_cobble.png"},
  194. is_ground_content = false,
  195. groups = utility.dig_groups("cobble", {
  196. stone = 1, native_stone = 1,
  197. melts = 1, cobble_type = 1,
  198. }),
  199. sounds = default.node_sound_stone_defaults(),
  200. _melts_to = "cavestuff:cobble_with_rockmelt",
  201. _is_bulk_mapgen_stone = true,
  202. -- Common stone does not count toward tool's dig count.
  203. _toolranks = {
  204. ignore = true,
  205. },
  206. _no_auto_pop = true,
  207. })
  208. minetest.register_node("default:stonebrick", {
  209. description = "Stone Brick",
  210. paramtype2 = "facedir",
  211. place_param2 = 0,
  212. tiles = {"default_stone_brick.png"},
  213. is_ground_content = false,
  214. groups = utility.dig_groups("brick", {brick = 1}),
  215. sounds = default.node_sound_stone_defaults(),
  216. })
  217. minetest.register_node("default:stone_block", {
  218. description = "Stone Block",
  219. tiles = {"default_stone_block.png"},
  220. is_ground_content = false,
  221. groups = utility.dig_groups("block", {stone=1, block = 1}),
  222. sounds = default.node_sound_stone_defaults(),
  223. })
  224. minetest.register_node("default:mossycobble", {
  225. description = "Mossy Cobblestone",
  226. tiles = {"default_mossycobble.png"},
  227. is_ground_content = false,
  228. groups = utility.dig_groups("cobble", {
  229. stone = 1, native_stone = 1,
  230. melts = 1,
  231. }),
  232. _melts_to = "cavestuff:cobble_with_rockmelt",
  233. sounds = default.node_sound_stone_defaults(),
  234. _is_bulk_mapgen_stone = true,
  235. })
  236. minetest.register_node("default:desert_stone", {
  237. description = "Redstone",
  238. tiles = {{name="desert_stone_macro.png", align_style="world", scale=8}},
  239. groups = utility.dig_groups("stone", {stone = 1, native_stone = 1}),
  240. drop = 'default:desert_cobble2',
  241. legacy_mineral = true,
  242. sounds = default.node_sound_stone_defaults(),
  243. _is_bulk_mapgen_stone = true,
  244. -- Common stone does not count toward tool's dig count.
  245. _toolranks = {
  246. ignore = true,
  247. },
  248. -- Made desert stone a road material on March 16, 2018.
  249. movement_speed_multiplier = default.ROAD_SPEED,
  250. -- Collapsed stone breaks up into cobble.
  251. on_finish_collapse = function(pos, node)
  252. minetest.swap_node(pos, {name="default:desert_cobble2"})
  253. end,
  254. on_collapse_to_entity = function(pos, node)
  255. minetest.add_item(pos, {name="default:desert_cobble2"})
  256. end,
  257. })
  258. minetest.register_node("default:desert_cobble", {
  259. description = "Chalked Redstone Cobble",
  260. tiles = {"default_desert_cobble.png"}, -- Original "chalked" image (pre 5.0.0).
  261. is_ground_content = false,
  262. groups = utility.dig_groups("cobble", {stone = 1, native_stone = 1}),
  263. sounds = default.node_sound_stone_defaults(),
  264. _is_bulk_mapgen_stone = true,
  265. })
  266. minetest.register_node("default:desert_cobble2", {
  267. description = "Redstone Cobble",
  268. tiles = {"default_desert_cobble2.png"},
  269. is_ground_content = false,
  270. groups = utility.dig_groups("cobble"),
  271. sounds = default.node_sound_stone_defaults(),
  272. _is_bulk_mapgen_stone = true,
  273. -- Common stone does not count toward tool's dig count.
  274. _toolranks = {
  275. ignore = true,
  276. },
  277. })
  278. minetest.register_node("default:desert_stonebrick", {
  279. description = "Redstone Brick",
  280. paramtype2 = "facedir",
  281. place_param2 = 0,
  282. tiles = {"default_desert_stone_brick.png"},
  283. is_ground_content = false,
  284. groups = utility.dig_groups("brick", {stone = 1, brick=1}),
  285. sounds = default.node_sound_stone_defaults(),
  286. })
  287. minetest.register_node("default:desert_stone_block", {
  288. description = "Redstone Block",
  289. tiles = {"default_desert_stone_block.png"},
  290. is_ground_content = false,
  291. groups = utility.dig_groups("block", {stone = 1, block=1}),
  292. sounds = default.node_sound_stone_defaults(),
  293. })
  294. minetest.register_node("default:sandstone", {
  295. description = "Sandstone",
  296. tiles = {"default_sandstone.png"},
  297. groups = utility.dig_groups("softstone", {stone=1}),
  298. sounds = default.node_sound_stone_defaults(),
  299. _is_bulk_mapgen_stone = true,
  300. -- Added on March 16, 2018.
  301. movement_speed_multiplier = default.ROAD_SPEED,
  302. })
  303. minetest.register_node("default:sandstonebrick", {
  304. description = "Sandstone Brick",
  305. paramtype2 = "facedir",
  306. place_param2 = 0,
  307. tiles = {"default_sandstone_brick.png"},
  308. is_ground_content = false,
  309. groups = utility.dig_groups("brick", {brick=1}),
  310. sounds = default.node_sound_stone_defaults(),
  311. })
  312. minetest.register_node("default:sandstone_block", {
  313. description = "Sandstone Block",
  314. tiles = {"default_sandstone_block.png"},
  315. is_ground_content = false,
  316. groups = utility.dig_groups("block", {block=1}),
  317. sounds = default.node_sound_stone_defaults(),
  318. })
  319. minetest.register_node("default:desert_sandstone", {
  320. description = "Desert Sandstone",
  321. tiles = {"default_desert_sandstone.png"},
  322. groups = utility.dig_groups("softstone", {stone=1}),
  323. sounds = default.node_sound_stone_defaults(),
  324. movement_speed_multiplier = default.ROAD_SPEED,
  325. _is_bulk_mapgen_stone = true,
  326. })
  327. minetest.register_node("default:desert_sandstone_brick", {
  328. description = "Desert Sandstone Brick",
  329. paramtype2 = "facedir",
  330. place_param2 = 0,
  331. tiles = {"default_desert_sandstone_brick.png"},
  332. is_ground_content = false,
  333. groups = utility.dig_groups("brick", {brick=1}),
  334. sounds = default.node_sound_stone_defaults(),
  335. })
  336. minetest.register_node("default:desert_sandstone_block", {
  337. description = "Desert Sandstone Block",
  338. tiles = {"default_desert_sandstone_block.png"},
  339. is_ground_content = false,
  340. groups = utility.dig_groups("block", {block=1}),
  341. sounds = default.node_sound_stone_defaults(),
  342. })
  343. minetest.register_node("default:silver_sandstone", {
  344. description = "Silver Sandstone",
  345. tiles = {"default_silver_sandstone.png"},
  346. groups = utility.dig_groups("softstone", {stone=1}),
  347. sounds = default.node_sound_stone_defaults(),
  348. movement_speed_multiplier = default.ROAD_SPEED,
  349. _is_bulk_mapgen_stone = true,
  350. })
  351. minetest.register_node("default:silver_sandstone_brick", {
  352. description = "Silver Sandstone Brick",
  353. paramtype2 = "facedir",
  354. place_param2 = 0,
  355. tiles = {"default_silver_sandstone_brick.png"},
  356. is_ground_content = false,
  357. groups = utility.dig_groups("brick", {brick=1}),
  358. sounds = default.node_sound_stone_defaults(),
  359. })
  360. minetest.register_node("default:silver_sandstone_block", {
  361. description = "Silver Sandstone Block",
  362. tiles = {"default_silver_sandstone_block.png"},
  363. is_ground_content = false,
  364. groups = utility.dig_groups("block", {block=1}),
  365. sounds = default.node_sound_stone_defaults(),
  366. })
  367. minetest.register_node("default:obsidian", {
  368. description = "Obsidian",
  369. tiles = {"default_obsidian.png"},
  370. sounds = default.node_sound_stone_defaults(),
  371. groups = utility.dig_groups("obsidian", {stone=1}),
  372. on_blast = function(...) end, -- Blast resistant.
  373. movement_speed_multiplier = default.ROAD_SPEED_CAVERN,
  374. node_dig_prediction = "",
  375. -- Callbacks are overridden in flameportal mod!
  376. crushing_damage = 5000,
  377. })
  378. minetest.register_node("default:obsidianbrick", {
  379. description = "Obsidian Brick",
  380. paramtype2 = "facedir",
  381. place_param2 = 0,
  382. tiles = {"default_obsidian_brick.png"},
  383. is_ground_content = false,
  384. sounds = default.node_sound_stone_defaults(),
  385. groups = utility.dig_groups("brick", {stone=1, brick=1}),
  386. on_blast = function(...) end, -- Blast resistant.
  387. crushing_damage = 5000,
  388. node_dig_prediction = "",
  389. })
  390. minetest.register_node("default:obsidian_block", {
  391. description = "Obsidian Block",
  392. tiles = {"default_obsidian_block.png"},
  393. is_ground_content = false,
  394. sounds = default.node_sound_stone_defaults(),
  395. groups = utility.dig_groups("block", {stone=1, block=1}),
  396. on_blast = function(...) end, -- Blast resistant.
  397. crushing_damage = 5000,
  398. node_dig_prediction = "",
  399. })
  400. --
  401. -- Soft / Non-Stone
  402. --
  403. minetest.register_node("default:dirt", {
  404. description = "Dirt",
  405. tiles = {"default_dirt.png"},
  406. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_sterile_dirt_type = 1, raw_dirt_type = 1, soil = 1}),
  407. post_effect_color = {a=255, r=0, g=0, b=0},
  408. sounds = default.node_sound_dirt_defaults(),
  409. movement_speed_multiplier = default.SLOW_SPEED,
  410. })
  411. minetest.register_node("default:dirt_with_grass", {
  412. description = "Dirt With Grass",
  413. tiles = {
  414. "default_grass.png",
  415. "default_dirt.png",
  416. {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false},
  417. },
  418. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, soil = 1}),
  419. drop = 'default:dirt',
  420. post_effect_color = {a=255, r=0, g=0, b=0},
  421. sounds = default.node_sound_dirt_defaults({
  422. footstep = {name = "default_grass_footstep", gain = 0.25},
  423. }),
  424. -- Depreciated.
  425. --on_timer = function(...)
  426. -- return dirtspread.dirt_on_timer(...)
  427. --end,
  428. on_finish_collapse = function(pos, node)
  429. minetest.swap_node(pos, {name="default:dirt"})
  430. end,
  431. on_collapse_to_entity = function(pos, node)
  432. minetest.add_item(pos, {name="default:dirt"})
  433. end,
  434. movement_speed_multiplier = default.SLOW_SPEED_GRASS,
  435. })
  436. -- Does this node even exist in the world?
  437. minetest.register_node("default:dirt_with_grass_footsteps", {
  438. description = "Dirt With Grass And Footsteps",
  439. tiles = {
  440. "default_grass.png^default_footprint.png",
  441. "default_dirt.png",
  442. {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false},
  443. },
  444. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, soil = 1, not_in_creative_inventory = 1}),
  445. drop = 'default:dirt',
  446. post_effect_color = {a=255, r=0, g=0, b=0},
  447. sounds = default.node_sound_dirt_defaults({
  448. footstep = {name = "default_grass_footstep", gain = 0.25},
  449. }),
  450. -- Depreciated.
  451. --on_timer = function(...)
  452. -- return dirtspread.dirt_on_timer(...)
  453. --end,
  454. on_finish_collapse = function(pos, node)
  455. minetest.swap_node(pos, {name="default:dirt"})
  456. end,
  457. on_collapse_to_entity = function(pos, node)
  458. minetest.add_item(pos, {name="default:dirt"})
  459. end,
  460. movement_speed_multiplier = default.SLOW_SPEED_GRASS,
  461. })
  462. minetest.register_node("default:dirt_with_dry_grass", {
  463. description = "Dirt With Dry Grass",
  464. tiles = {
  465. "default_dry_grass.png",
  466. "default_dirt.png",
  467. {name = "default_dirt.png^default_dry_grass_side.png", tileable_vertical = false},
  468. },
  469. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, soil = 1}),
  470. drop = 'default:dirt',
  471. post_effect_color = {a=255, r=0, g=0, b=0},
  472. sounds = default.node_sound_dirt_defaults({
  473. footstep = {name = "default_grass_footstep", gain = 0.4},
  474. }),
  475. -- Depreciated.
  476. --on_timer = function(...)
  477. -- return dirtspread.dirt_on_timer(...)
  478. --end,
  479. on_finish_collapse = function(pos, node)
  480. minetest.swap_node(pos, {name="default:dirt"})
  481. end,
  482. on_collapse_to_entity = function(pos, node)
  483. minetest.add_item(pos, {name="default:dirt"})
  484. end,
  485. movement_speed_multiplier = default.SLOW_SPEED_GRASS,
  486. })
  487. minetest.register_node("default:dirt_with_snow", {
  488. description = "Dirt With Snow",
  489. tiles = {
  490. "default_snow.png",
  491. "default_dirt.png",
  492. {name = "default_dirt.png^default_snow_side.png", tileable_vertical = false},
  493. },
  494. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, snowy_dirt_type = 1, snowy = 1, cold = 1}),
  495. drop = 'default:dirt',
  496. post_effect_color = {a=255, r=0, g=0, b=0},
  497. sounds = default.node_sound_dirt_defaults({
  498. footstep = {name = "default_snow_footstep", gain = 0.2},
  499. }),
  500. -- Depreciated.
  501. --on_timer = function(...)
  502. -- return dirtspread.dirt_on_timer(...)
  503. --end,
  504. -- Dirt with snow does not need to turn back to dirt if it falls. After all, snow does not have roots that would be broken, unlike grass.
  505. --[[
  506. on_finish_collapse = function(pos, node)
  507. minetest.swap_node(pos, {name="default:dirt"})
  508. end,
  509. on_collapse_to_entity = function(pos, node)
  510. minetest.add_item(pos, {name="default:dirt"})
  511. end,
  512. --]]
  513. movement_speed_multiplier = default.SLOW_SPEED,
  514. })
  515. minetest.register_node("default:dark_dirt_with_snow", {
  516. description = "Sterile Dirt With Snow",
  517. tiles = {
  518. "default_snow.png",
  519. "darkage_darkdirt.png",
  520. {name = "darkage_darkdirt.png^default_snow_side.png", tileable_vertical = false},
  521. },
  522. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, sterile_dirt_type = 1, snowy_dirt_type = 1, snowy = 1, cold = 1}),
  523. drop = 'darkage:darkdirt',
  524. post_effect_color = {a=255, r=0, g=0, b=0},
  525. sounds = default.node_sound_dirt_defaults({
  526. footstep = {name = "default_snow_footstep", gain = 0.2},
  527. }),
  528. -- Depreciated.
  529. --on_timer = function(...)
  530. -- return dirtspread.dirt_on_timer(...)
  531. --end,
  532. -- Dirt with snow does not need to turn back to dirt if it falls. After all, snow does not have roots that would be broken, unlike grass.
  533. --[[
  534. on_finish_collapse = function(pos, node)
  535. minetest.swap_node(pos, {name="darkage:darkdirt"})
  536. end,
  537. on_collapse_to_entity = function(pos, node)
  538. minetest.add_item(pos, {name="darkage:darkdirt"})
  539. end,
  540. --]]
  541. movement_speed_multiplier = default.SLOW_SPEED,
  542. })
  543. minetest.register_node("default:dry_dirt_with_snow", {
  544. description = "Dry Dirt With Snow",
  545. tiles = {
  546. "default_snow.png",
  547. "default_dry_dirt.png",
  548. {name = "default_dry_dirt.png^default_snow_side.png", tileable_vertical = false},
  549. },
  550. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, dry_dirt_type = 1, snowy_dirt_type = 1, snowy = 1, cold = 1}),
  551. drop = 'default:dry_dirt',
  552. post_effect_color = {a=255, r=0, g=0, b=0},
  553. sounds = default.node_sound_dirt_defaults({
  554. footstep = {name = "default_snow_footstep", gain = 0.2},
  555. }),
  556. -- Depreciated.
  557. --on_timer = function(...)
  558. -- return dirtspread.dirt_on_timer(...)
  559. --end,
  560. -- Dirt with snow does not need to turn back to dirt if it falls. After all, snow does not have roots that would be broken, unlike grass.
  561. --[[
  562. on_finish_collapse = function(pos, node)
  563. minetest.swap_node(pos, {name="default:dry_dirt"})
  564. end,
  565. on_collapse_to_entity = function(pos, node)
  566. minetest.add_item(pos, {name="default:dry_dirt"})
  567. end,
  568. --]]
  569. movement_speed_multiplier = default.SLOW_SPEED,
  570. })
  571. minetest.register_node("default:dirt_with_rainforest_litter", {
  572. description = "Dirt With Leaf Litter",
  573. tiles = {
  574. "default_rainforest_litter.png",
  575. "default_dirt.png",
  576. {name = "default_dirt.png^default_rainforest_litter_side.png", tileable_vertical = false},
  577. },
  578. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, non_sterile_dirt_type = 1, soil = 1}),
  579. drop = "default:dirt",
  580. post_effect_color = {a=255, r=0, g=0, b=0},
  581. sounds = default.node_sound_dirt_defaults({
  582. footstep = {name = "default_grass_footstep", gain = 0.4},
  583. }),
  584. on_finish_collapse = function(pos, node)
  585. minetest.swap_node(pos, {name="default:dirt"})
  586. end,
  587. on_collapse_to_entity = function(pos, node)
  588. minetest.add_item(pos, {name="default:dirt"})
  589. end,
  590. movement_speed_multiplier = default.SLOW_SPEED,
  591. })
  592. minetest.register_node("default:dark_dirt_with_rainforest_litter", {
  593. description = "Sterile Dirt With Leaf Litter",
  594. tiles = {
  595. "default_rainforest_litter.png",
  596. "darkage_darkdirt.png",
  597. {name = "darkage_darkdirt.png^default_rainforest_litter_side.png", tileable_vertical = false},
  598. },
  599. groups = utility.dig_groups("dirt", {dirt_type = 1, leafy_dirt_type = 1, non_raw_dirt_type = 1, sterile_dirt_type = 1, falling_node = 1}),
  600. drop = "darkage:darkdirt",
  601. post_effect_color = {a=255, r=0, g=0, b=0},
  602. sounds = default.node_sound_dirt_defaults({
  603. footstep = {name = "default_grass_footstep", gain = 0.4},
  604. }),
  605. on_finish_collapse = function(pos, node)
  606. minetest.swap_node(pos, {name="darkage:darkdirt"})
  607. end,
  608. on_collapse_to_entity = function(pos, node)
  609. minetest.add_item(pos, {name="darkage:darkdirt"})
  610. end,
  611. movement_speed_multiplier = default.SLOW_SPEED,
  612. })
  613. minetest.register_node("default:dry_dirt_with_rainforest_litter", {
  614. description = "Dry Dirt With Leaf Litter",
  615. tiles = {
  616. "default_rainforest_litter.png",
  617. "default_dry_dirt.png",
  618. {name = "default_dry_dirt.png^default_rainforest_litter_side.png", tileable_vertical = false},
  619. },
  620. groups = utility.dig_groups("dirt", {dirt_type = 1, non_sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, dry_dirt_type = 1, falling_node = 1}),
  621. drop = "default:dry_dirt",
  622. post_effect_color = {a=255, r=0, g=0, b=0},
  623. sounds = default.node_sound_dirt_defaults(),
  624. on_finish_collapse = function(pos, node)
  625. minetest.swap_node(pos, {name="default:dry_dirt"})
  626. end,
  627. on_collapse_to_entity = function(pos, node)
  628. minetest.add_item(pos, {name="default:dry_dirt"})
  629. end,
  630. movement_speed_multiplier = default.SLOW_SPEED,
  631. })
  632. minetest.register_node("default:dirt_with_coniferous_litter", {
  633. description = "Dirt With Acidic Litter",
  634. tiles = {
  635. "default_coniferous_litter.png",
  636. "default_dirt.png",
  637. {name = "default_dirt.png^default_coniferous_litter_side.png", tileable_vertical = false},
  638. },
  639. groups = utility.dig_groups("dirt", {falling_node = 1, non_sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, dirt_type = 1, soil = 1}),
  640. drop = "default:dirt",
  641. post_effect_color = {a=255, r=0, g=0, b=0},
  642. sounds = default.node_sound_dirt_defaults({
  643. footstep = {name = "default_grass_footstep", gain = 0.4},
  644. }),
  645. on_finish_collapse = function(pos, node)
  646. minetest.swap_node(pos, {name="default:dirt"})
  647. end,
  648. on_collapse_to_entity = function(pos, node)
  649. minetest.add_item(pos, {name="default:dirt"})
  650. end,
  651. movement_speed_multiplier = default.SLOW_SPEED,
  652. })
  653. minetest.register_node("default:dark_dirt_with_coniferous_litter", {
  654. description = "Sterile Dirt With Acidic Litter",
  655. tiles = {
  656. "default_coniferous_litter.png",
  657. "darkage_darkdirt.png",
  658. {name = "darkage_darkdirt.png^default_coniferous_litter_side.png", tileable_vertical = false},
  659. },
  660. groups = utility.dig_groups("dirt", {dirt_type = 1, sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, falling_node = 1}),
  661. drop = "darkage:darkdirt",
  662. post_effect_color = {a=255, r=0, g=0, b=0},
  663. sounds = default.node_sound_dirt_defaults({
  664. footstep = {name = "default_grass_footstep", gain = 0.4},
  665. }),
  666. on_finish_collapse = function(pos, node)
  667. minetest.swap_node(pos, {name="darkage:darkdirt"})
  668. end,
  669. on_collapse_to_entity = function(pos, node)
  670. minetest.add_item(pos, {name="darkage:darkdirt"})
  671. end,
  672. movement_speed_multiplier = default.SLOW_SPEED,
  673. })
  674. minetest.register_node("default:dry_dirt_with_coniferous_litter", {
  675. description = "Dry Dirt With Acidic Litter",
  676. tiles = {
  677. "default_coniferous_litter.png",
  678. "default_dry_dirt.png",
  679. {name = "default_dry_dirt.png^default_coniferous_litter_side.png", tileable_vertical = false},
  680. },
  681. groups = utility.dig_groups("dirt", {dirt_type = 1, non_sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, dry_dirt_type = 1, falling_node = 1}),
  682. drop = "default:dry_dirt",
  683. post_effect_color = {a=255, r=0, g=0, b=0},
  684. sounds = default.node_sound_dirt_defaults(),
  685. on_finish_collapse = function(pos, node)
  686. minetest.swap_node(pos, {name="default:dry_dirt"})
  687. end,
  688. on_collapse_to_entity = function(pos, node)
  689. minetest.add_item(pos, {name="default:dry_dirt"})
  690. end,
  691. movement_speed_multiplier = default.SLOW_SPEED,
  692. })
  693. minetest.register_node("default:dry_dirt", {
  694. description = "Dry Dirt",
  695. tiles = {"default_dry_dirt.png"},
  696. groups = utility.dig_groups("dirt", {dirt_type = 1, dry_dirt_type = 1, non_sterile_dirt_type = 1, raw_dirt_type = 1, falling_node = 1}),
  697. post_effect_color = {a=255, r=0, g=0, b=0},
  698. sounds = default.node_sound_dirt_defaults(),
  699. movement_speed_multiplier = default.SLOW_SPEED,
  700. })
  701. minetest.register_node("default:dry_dirt_with_dry_grass", {
  702. description = "Dry Dirt With Dry Grass",
  703. tiles = {
  704. "default_dry_grass.png",
  705. "default_dry_dirt.png",
  706. {name = "default_dry_dirt.png^default_dry_grass_side.png", tileable_vertical = false},
  707. },
  708. groups = utility.dig_groups("dirt", {dirt_type = 1, dry_dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, falling_node = 1}),
  709. drop = "default:dry_dirt",
  710. post_effect_color = {a=255, r=0, g=0, b=0},
  711. sounds = default.node_sound_dirt_defaults({
  712. footstep = {name = "default_grass_footstep", gain = 0.4},
  713. }),
  714. on_finish_collapse = function(pos, node)
  715. minetest.swap_node(pos, {name="default:dry_dirt"})
  716. end,
  717. on_collapse_to_entity = function(pos, node)
  718. minetest.add_item(pos, {name="default:dry_dirt"})
  719. end,
  720. movement_speed_multiplier = default.SLOW_SPEED,
  721. })
  722. minetest.register_node("default:permafrost", {
  723. description = "Permafrost",
  724. tiles = {"default_permafrost.png"},
  725. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  726. sounds = default.node_sound_dirt_defaults(),
  727. movement_speed_multiplier = default.SLOW_SPEED,
  728. })
  729. minetest.register_node("default:permafrost_with_snow", {
  730. description = "Permafrost With Snow",
  731. tiles = {
  732. "default_snow.png",
  733. "default_permafrost.png",
  734. {name = "default_permafrost.png^default_snow_side.png", tileable_vertical = false},
  735. },
  736. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1, snowy = 1}),
  737. sounds = default.node_sound_dirt_defaults(),
  738. movement_speed_multiplier = default.SLOW_SPEED,
  739. })
  740. minetest.register_node("default:permafrost_with_stones", {
  741. description = "Permafrost With Stones",
  742. tiles = {
  743. "default_permafrost.png^default_stones.png",
  744. "default_permafrost.png",
  745. "default_permafrost.png^default_stones_side.png",
  746. },
  747. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  748. sounds = default.node_sound_gravel_defaults(),
  749. movement_speed_multiplier = default.SLOW_SPEED,
  750. })
  751. minetest.register_node("default:permafrost_with_snow_and_stones", {
  752. description = "Permafrost With Snow And Stones",
  753. tiles = {
  754. "default_permafrost.png^default_snow.png^default_stones.png",
  755. "default_permafrost.png",
  756. "default_permafrost.png^default_snow_side.png^default_stones_side.png",
  757. },
  758. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1, snowy = 1}),
  759. sounds = default.node_sound_gravel_defaults(),
  760. movement_speed_multiplier = default.SLOW_SPEED,
  761. })
  762. minetest.register_node("default:permafrost_with_moss", {
  763. description = "Permafrost With Moss",
  764. tiles = {
  765. "default_moss.png",
  766. "default_permafrost.png",
  767. {name = "default_permafrost.png^default_moss_side.png", tileable_vertical = false},
  768. },
  769. drop = "default:permafrost",
  770. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  771. sounds = default.node_sound_dirt_defaults({
  772. footstep = {name = "default_grass_footstep", gain = 0.25},
  773. }),
  774. on_finish_collapse = function(pos, node)
  775. minetest.swap_node(pos, {name="default:permafrost"})
  776. end,
  777. on_collapse_to_entity = function(pos, node)
  778. minetest.add_item(pos, {name="default:permafrost"})
  779. end,
  780. movement_speed_multiplier = default.SLOW_SPEED,
  781. })
  782. minetest.register_node("default:permafrost_with_moss_and_stones", {
  783. description = "Permafrost With Moss And Stones",
  784. tiles = {
  785. "default_moss.png^default_stones.png",
  786. "default_permafrost.png",
  787. {name = "default_permafrost.png^default_moss_side.png^default_stones_side.png", tileable_vertical = false},
  788. },
  789. drop = "default:permafrost_with_stones",
  790. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  791. sounds = default.node_sound_dirt_defaults({
  792. footstep = {name = "default_grass_footstep", gain = 0.25},
  793. }),
  794. on_finish_collapse = function(pos, node)
  795. minetest.swap_node(pos, {name="default:permafrost_with_stones"})
  796. end,
  797. on_collapse_to_entity = function(pos, node)
  798. minetest.add_item(pos, {name="default:permafrost_with_stones"})
  799. end,
  800. movement_speed_multiplier = default.SLOW_SPEED,
  801. })
  802. minetest.register_node("default:sand", {
  803. description = "Sand",
  804. tiles = {"default_sand.png"},
  805. groups = utility.dig_groups("sand", {falling_node = 1, sand = 1, fall_damage_add_percent = -20}),
  806. post_effect_color = {a=255, r=0, g=0, b=0},
  807. sounds = default.node_sound_sand_defaults(),
  808. movement_speed_multiplier = default.SLOW_SPEED,
  809. })
  810. minetest.register_node("default:desert_sand", {
  811. description = "Desert Sand",
  812. tiles = {"default_desert_sand.png"},
  813. groups = utility.dig_groups("sand", {falling_node = 1, sand = 1, fall_damage_add_percent = -20, soil = 1}),
  814. sounds = default.node_sound_sand_defaults(),
  815. movement_speed_multiplier = default.SLOW_SPEED,
  816. })
  817. minetest.register_node("default:gravel", {
  818. description = "Gravel",
  819. tiles = {"default_gravel.png"},
  820. groups = utility.dig_groups("gravel", {falling_node = 1, gravel = 1}),
  821. sounds = default.node_sound_gravel_defaults(),
  822. drop = {
  823. max_items = 1,
  824. items = {
  825. {items = {'default:flint'}, rarity = 16},
  826. {items = {'default:gravel'}}
  827. }
  828. },
  829. post_effect_color = {a=255, r=0, g=0, b=0},
  830. -- Gravel is a component of wisp nests in Jarkati.
  831. after_destruct = function(pos, oldnode)
  832. local a = vector_add(pos, {x=0, y=1, z=0})
  833. local n = minetest.get_node(a)
  834. if n.name == "pm:spawner" then
  835. minetest.remove_node(a)
  836. end
  837. end,
  838. })
  839. minetest.register_node("default:clay", {
  840. description = "Clay",
  841. tiles = {"default_clay.png"},
  842. groups = utility.dig_groups("clay"),
  843. drop = 'default:clay_lump 4',
  844. sounds = default.node_sound_dirt_defaults(),
  845. movement_speed_multiplier = default.SLOW_SPEED,
  846. })
  847. minetest.register_node("default:snowblock", {
  848. description = "Snow Block",
  849. tiles = {"default_snow.png"},
  850. groups = utility.dig_groups("sand", {
  851. puts_out_fire = 1,
  852. snow = 1,
  853. snowy = 1,
  854. cold = 1,
  855. falling_node = 1,
  856. melts = 1,
  857. fall_damage_add_percent = -20,
  858. -- Currently used to notify ice nodes.
  859. notify_construct = 1,
  860. want_notify = 1,
  861. }),
  862. movement_speed_multiplier = default.SLOW_SPEED,
  863. _melts_to = "default:water_flowing",
  864. --damage_per_second = 2*500,
  865. post_effect_color = {a=255, r=255, g=255, b=255},
  866. sounds = default.node_sound_snow_defaults(),
  867. -- Hack to notify self.
  868. on_construct = function(pos)
  869. minetest.get_node_timer(pos):start(math_random(ice.minmax_time()))
  870. end,
  871. on_notify = function(...)
  872. return ice.on_ice_notify(...)
  873. end,
  874. on_timer = function(pos, elapsed)
  875. if rc.ice_melts_at_pos(pos) then
  876. minetest.add_node(pos, {name="default:water_flowing"})
  877. return
  878. end
  879. return ice.on_ice_timer(pos, elapsed)
  880. end,
  881. })
  882. minetest.register_node("default:ice", {
  883. description = "Ice",
  884. tiles = {"default_ice.png"},
  885. is_ground_content = false,
  886. paramtype = "light",
  887. groups = utility.dig_groups("ice", {
  888. ice = 1,
  889. cold = 1,
  890. --puts_out_fire = 1,
  891. melts = 1,
  892. want_notify = 1,
  893. slippery = 3,
  894. }),
  895. _melts_to = "default:water_flowing",
  896. sounds = default.node_sound_glass_defaults(),
  897. movement_speed_multiplier = default.SLOW_SPEED_ICE,
  898. -- Common ice does not count toward tool's dig count.
  899. _toolranks = {
  900. ignore = true,
  901. },
  902. _no_auto_pop = true,
  903. _is_bulk_mapgen_stone = true,
  904. -- Hack to notify self.
  905. on_construct = function(pos)
  906. minetest.get_node_timer(pos):start(math_random(ice.minmax_time()))
  907. end,
  908. on_notify = function(...)
  909. return ice.on_ice_notify(...)
  910. end,
  911. on_timer = function(pos, elapsed)
  912. if rc.ice_melts_at_pos(pos) then
  913. minetest.add_node(pos, {name="default:water_flowing"})
  914. return
  915. end
  916. return ice.on_ice_timer(pos, elapsed)
  917. end,
  918. })
  919. --
  920. -- Trees
  921. --
  922. --
  923. -- Ores
  924. --
  925. minetest.register_node("default:stone_with_coal", {
  926. description = "Coal Deposit",
  927. tiles = {"default_stone.png^default_mineral_coal.png"},
  928. -- Cannot be flammable (although I would like it to be)
  929. -- because that interferes with TNT mining (the TNT replaces
  930. -- all coal with flame instead of dropping it).
  931. groups = utility.dig_groups("mineral"),
  932. drop = 'default:coal_lump',
  933. silverpick_drop = true,
  934. sounds = default.node_sound_stone_defaults(),
  935. place_param2 = 10,
  936. -- Digging coal ore has a chance to release poison gas.
  937. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  938. if pos.y < -1024 then
  939. if math_random(1, 300) == 1 then
  940. breath.spawn_gas(pos)
  941. end
  942. end
  943. end,
  944. })
  945. minetest.register_node("default:desert_stone_with_coal", {
  946. description = "Redstone Coal Deposit",
  947. tiles = {"default_desert_stone.png^default_mineral_coal2.png"},
  948. -- Cannot be flammable (although I would like it to be)
  949. -- because that interferes with TNT mining (the TNT replaces
  950. -- all coal with flame instead of dropping it).
  951. groups = utility.dig_groups("mineral"),
  952. drop = 'default:coal_lump',
  953. silverpick_drop = true,
  954. sounds = default.node_sound_stone_defaults(),
  955. place_param2 = 10,
  956. })
  957. minetest.register_node("default:coalblock", {
  958. description = "Coal Block",
  959. tiles = {"default_coal_block.png"},
  960. is_ground_content = false,
  961. groups = utility.dig_groups("cobble", {flammable = 3}),
  962. sounds = default.node_sound_stone_defaults(),
  963. })
  964. minetest.register_node("default:stone_with_iron", {
  965. description = "Iron Ore",
  966. tiles = {"default_stone.png^default_mineral_iron.png"},
  967. groups = utility.dig_groups("mineral", {ore = 1}),
  968. drop = 'default:iron_lump',
  969. _tnt_drop = 'default:iron_lump 2',
  970. silverpick_drop = true,
  971. sounds = default.node_sound_stone_defaults(),
  972. place_param2 = 10,
  973. })
  974. minetest.register_node("default:steelblock", {
  975. description = "Wrought Iron Block",
  976. tiles = {"default_steel_block.png"},
  977. is_ground_content = false,
  978. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  979. sounds = default.node_sound_metal_defaults(),
  980. })
  981. minetest.register_node("default:stone_with_copper", {
  982. description = "Copper Ore",
  983. tiles = {"default_stone.png^default_mineral_copper.png"},
  984. groups = utility.dig_groups("mineral", {ore = 1}),
  985. drop = 'default:copper_lump',
  986. _tnt_drop = 'default:copper_lump 2',
  987. silverpick_drop = true,
  988. sounds = default.node_sound_stone_defaults(),
  989. place_param2 = 10,
  990. })
  991. minetest.register_node("default:desert_stone_with_copper", {
  992. description = "Redstone Copper Ore",
  993. -- Use old copper image, the pattern looks nicer.
  994. tiles = {"default_desert_stone.png^default_mineral_copper2.png"},
  995. groups = utility.dig_groups("mineral", {ore = 1}),
  996. drop = 'default:copper_lump',
  997. _tnt_drop = 'default:copper_lump 2',
  998. silverpick_drop = true,
  999. sounds = default.node_sound_stone_defaults(),
  1000. place_param2 = 10,
  1001. })
  1002. minetest.register_node("default:desert_stone_with_iron", {
  1003. description = "Redstone Iron Ore",
  1004. -- Use old iron image, the pattern looks nicer.
  1005. tiles = {"default_desert_stone.png^default_mineral_iron2.png"},
  1006. groups = utility.dig_groups("mineral", {ore = 1}),
  1007. drop = 'default:iron_lump',
  1008. _tnt_drop = 'default:iron_lump 2',
  1009. silverpick_drop = true,
  1010. sounds = default.node_sound_stone_defaults(),
  1011. place_param2 = 10,
  1012. })
  1013. minetest.register_node("default:desert_stone_with_diamond", {
  1014. description = "Redstone Diamond Deposit",
  1015. -- Use old diamond image, the pattern looks nicer.
  1016. tiles = {"default_desert_stone.png^default_mineral_diamond2.png"},
  1017. groups = utility.dig_groups("hardmineral"),
  1018. drop = 'default:diamond',
  1019. _tnt_drop = {
  1020. 'default:diamond',
  1021. 'dusts:diamond_shard 3',
  1022. },
  1023. silverpick_drop = true,
  1024. sounds = default.node_sound_stone_defaults(),
  1025. place_param2 = 10,
  1026. })
  1027. minetest.register_node("default:copperblock", {
  1028. description = "Copper Block",
  1029. tiles = {"default_copper_block.png"},
  1030. is_ground_content = false,
  1031. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  1032. sounds = default.node_sound_metal_defaults(),
  1033. })
  1034. minetest.register_node("default:bronzeblock", {
  1035. description = "Bronze Block",
  1036. tiles = {"default_bronze_block.png"},
  1037. is_ground_content = false,
  1038. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  1039. sounds = default.node_sound_metal_defaults(),
  1040. })
  1041. minetest.register_node("default:stone_with_mese", {
  1042. description = "Mese Ore",
  1043. tiles = {"default_stone.png^default_mineral_mese.png"},
  1044. groups = utility.dig_groups("hardmineral", {melts = 1}),
  1045. drop = {
  1046. max_items = 2,
  1047. items = {
  1048. {items = {'mobs:flame_bolt'}, rarity = 32},
  1049. {items = {'default:mese_crystal'}}
  1050. }
  1051. },
  1052. _tnt_drop = "default:mese_crystal_fragment",
  1053. silverpick_drop = true,
  1054. sounds = default.node_sound_stone_defaults(),
  1055. -- Mese in stone reacts badly to lava.
  1056. on_melt = function(pos, other)
  1057. minetest.after(0, function()
  1058. tnt.boom(pos, {
  1059. radius = 4,
  1060. ignore_protection = false,
  1061. ignore_on_blast = false,
  1062. damage_radius = 6,
  1063. disable_drops = true,
  1064. })
  1065. end)
  1066. end,
  1067. })
  1068. minetest.register_node("default:mese", {
  1069. description = "Mese Block",
  1070. tiles = {"default_mese_block.png"},
  1071. paramtype = "light",
  1072. groups = utility.dig_groups("hardstone", {melts = 1}),
  1073. sounds = default.node_sound_stone_defaults(),
  1074. light_source = 3,
  1075. -- Mese in stone reacts badly to lava.
  1076. -- Meseblock makes a much larger blast.
  1077. on_melt = function(pos, other)
  1078. minetest.after(0, function()
  1079. tnt.boom(pos, {
  1080. radius = 10,
  1081. ignore_protection = false,
  1082. ignore_on_blast = false,
  1083. damage_radius = 20,
  1084. disable_drops = true,
  1085. })
  1086. end)
  1087. end,
  1088. on_blast = function(pos)
  1089. minetest.remove_node(pos)
  1090. if math.random(1, 20) > 1 then
  1091. return
  1092. end
  1093. minetest.after(math.random(1, 20) / 10, function()
  1094. tnt.boom(pos, {
  1095. radius = 10,
  1096. ignore_protection = false,
  1097. ignore_on_blast = true,
  1098. damage_radius = 20,
  1099. disable_drops = true,
  1100. })
  1101. end)
  1102. end,
  1103. })
  1104. minetest.register_node("default:stone_with_gold", {
  1105. description = "Gold Ore",
  1106. tiles = {"default_stone.png^default_mineral_gold.png"},
  1107. groups = utility.dig_groups("mineral", {ore = 1}),
  1108. drop = "default:gold_lump",
  1109. _tnt_drop = {
  1110. 'default:gold_lump',
  1111. 'dusts:gold 3',
  1112. },
  1113. silverpick_drop = true,
  1114. sounds = default.node_sound_stone_defaults(),
  1115. place_param2 = 10,
  1116. })
  1117. minetest.register_node("default:goldblock", {
  1118. description = "Gold Block",
  1119. tiles = {"default_gold_block.png"},
  1120. is_ground_content = false,
  1121. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  1122. sounds = default.node_sound_metal_defaults(),
  1123. })
  1124. minetest.register_node("default:stone_with_diamond", {
  1125. description = "Diamond Deposit",
  1126. tiles = {"default_stone.png^default_mineral_diamond.png"},
  1127. -- Player has to get mese pick or similar before they can get diamond.
  1128. groups = utility.dig_groups("hardmineral"),
  1129. drop = "default:diamond",
  1130. _tnt_drop = {
  1131. 'default:diamond',
  1132. 'dusts:diamond_shard 3',
  1133. },
  1134. silverpick_drop = true,
  1135. sounds = default.node_sound_stone_defaults(),
  1136. place_param2 = 10,
  1137. })
  1138. minetest.register_node("default:diamondblock", {
  1139. description = "Diamond Block",
  1140. tiles = {"default_diamond_block.png"},
  1141. is_ground_content = false,
  1142. groups = utility.dig_groups("obsidian"),
  1143. sounds = default.node_sound_stone_defaults(),
  1144. })
  1145. -- 'default_adamant.png' texture by 'WintersKnight94', CC0 1.0 Universal
  1146. -- world-align version by MustTest.
  1147. minetest.register_node("default:adamant", {
  1148. description = "Adamant",
  1149. tiles = {{name="default_adamant_32x32.png", align_style="world", scale=2}},
  1150. is_ground_content = false,
  1151. groups = {}, -- No valid digging groups for this node.
  1152. sounds = default.node_sound_stone_defaults(),
  1153. drop = "default:adamant_shard",
  1154. light_source = 6,
  1155. node_dig_prediction = "",
  1156. disallow_teleport = true,
  1157. -- Note: NOT blast resistant. May be TNT mined.
  1158. on_blast = function(pos)
  1159. local obsidian = minetest.find_node_near(pos, 1, "cavestuff:dark_obsidian")
  1160. if obsidian then
  1161. if math.random(1, 500) == 1 then
  1162. if utility.do_something_nasty then
  1163. minetest.after(math.random(1, 30), function()
  1164. utility.do_something_nasty(pos, "severe")
  1165. end)
  1166. end
  1167. end
  1168. minetest.remove_node(obsidian)
  1169. minetest.remove_node(pos)
  1170. -- The obsidian block is broken up.
  1171. return {"default:adamant_brittle", "default:obsidian_shard 4"}
  1172. end
  1173. end,
  1174. -- This is needed to fix a potential griefing vector re: dropping adamant on
  1175. -- protected properties. Otherwise dropped adamant would be impossible to
  1176. -- remove without causing damage to the property.
  1177. on_finish_collapse = function(pos, node)
  1178. minetest.swap_node(pos, {name = "default:adamant_brittle"})
  1179. end,
  1180. })
  1181. minetest.register_node("default:adamant_brittle", {
  1182. description = "Cracked Adamant",
  1183. tiles = {{name="default_adamant_cracked_32x32.png", align_style="world", scale=2}},
  1184. is_ground_content = false,
  1185. groups = utility.dig_groups("hardmineral"),
  1186. sounds = default.node_sound_stone_defaults(),
  1187. drop = "default:adamant_shard",
  1188. silverpick_drop = true,
  1189. light_source = 4,
  1190. })
  1191. --
  1192. -- Plantlife (non-cubic)
  1193. --
  1194. do
  1195. local nodebox = {
  1196. -- Spine strips.
  1197. {0, 1, 1, 16, 15, 1},
  1198. {0, 1, 15, 16, 15, 15},
  1199. {1, 1, 0, 1, 15, 16},
  1200. {15, 1, 0, 15, 15, 16},
  1201. -- Meat.
  1202. {1, 0, 1, 15, 16, 15},
  1203. -- Side skin.
  1204. {4, 0, 0, 12, 16, 16},
  1205. {0, 0, 4, 16, 16, 12},
  1206. }
  1207. local selectionbox = {
  1208. {1, 0, 1, 15, 16, 15},
  1209. }
  1210. utility.transform_nodebox(nodebox)
  1211. utility.transform_nodebox(selectionbox)
  1212. minetest.register_node("default:cactus", {
  1213. description = "Cactus",
  1214. tiles = {
  1215. "default_cactus_top.png",
  1216. "default_cactus_top.png",
  1217. "default_cactus_side.png"
  1218. },
  1219. paramtype = "light",
  1220. drawtype = "nodebox",
  1221. node_box = {
  1222. type = "fixed",
  1223. fixed = nodebox,
  1224. },
  1225. selection_box = {
  1226. type = "fixed",
  1227. fixed = selectionbox,
  1228. },
  1229. paramtype2 = "facedir",
  1230. groups = utility.dig_groups("softwood", {flammable = 1, fall_damage_add_percent = 100}),
  1231. sounds = default.node_sound_wood_defaults(),
  1232. on_place = minetest.rotate_node,
  1233. damage_per_second = 1*500,
  1234. _damage_per_second_type = "fleshy",
  1235. _death_message = "They impaled themself on a cactus.",
  1236. on_punch = function(pos, node, puncher, pt)
  1237. if not puncher or not puncher:is_player() then return end
  1238. local stack = puncher:get_wielded_item()
  1239. local name = stack:get_name() or ""
  1240. if not string.find(name, "axe") then
  1241. utility.damage_player(puncher, "fleshy", 1*500, "sharp")
  1242. end
  1243. end,
  1244. on_player_walk_over = function(pos, player)
  1245. utility.damage_player(player, "fleshy", 1*500, "ground")
  1246. if player:get_hp() == 0 then
  1247. minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on cactus. Noob!")
  1248. end
  1249. end,
  1250. on_construct = function(...)
  1251. return cactus.on_construct(...)
  1252. end,
  1253. on_destruct = function(...)
  1254. return cactus.on_destruct(...)
  1255. end,
  1256. on_timer = function(...)
  1257. return cactus.on_timer(...)
  1258. end,
  1259. after_dig_node = function(...)
  1260. return cactus.after_dig_node(...)
  1261. end,
  1262. })
  1263. end
  1264. --[[
  1265. --= Tests of Tools Against Default Groups =--
  1266. result_of {snappy = 1, choppy = 3} + tool=default:axe_stone : digsound=success
  1267. result_of {snappy = 1, choppy = 3} + tool=default:axe_diamond : digsound=success
  1268. result_of {snappy = 1, choppy = 3} + tool=default:axe_steel : digsound=success
  1269. result_of {snappy = 1, choppy = 3} + tool=default:axe_mese : digsound=success
  1270. result_of {snappy = 1, choppy = 3} + tool=default:sword_steel : digsound=failure
  1271. result_of {snappy = 1, choppy = 3} + tool=default:sword_stone : digsound=N/A (could not dig)
  1272. result_of {snappy = 1, choppy = 3} + tool=default:sword_diamond : digsound=failure
  1273. result_of {snappy = 1, choppy = 3} + tool=default:sword_mese : digsound=failure
  1274. result_of {snappy = 1, choppy = 3} + tool=default:shovel_stone : digsound=N/A (could not dig)
  1275. result_of {snappy = 1, choppy = 3} + tool=default:shovel_steel : digsound=N/A (could not dig)
  1276. result_of {snappy = 1, choppy = 3} + tool=default:shovel_diamond : digsound=N/A (could not dig)
  1277. result_of {snappy = 1, choppy = 3} + tool=default:shovel_mese : digsound=N/A (could not dig)
  1278. result_of {snappy = 1, choppy = 3} + tool=default:pick_stone : digsound=N/A (could not dig)
  1279. result_of {snappy = 1, choppy = 3} + tool=default:pick_steel : digsound=N/A (could not dig)
  1280. result_of {snappy = 1, choppy = 3} + tool=default:pick_diamond : digsound=N/A (could not dig)
  1281. result_of {snappy = 1, choppy = 3} + tool=default:pick_mese : digsound=N/A (could not dig)
  1282. --= Tests of Tools Against Modified Groups (A) =--
  1283. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_stone : digsound=N/A (could not dig)
  1284. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_steel : digsound=success
  1285. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_diamond : digsound=success
  1286. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_mese : digsound=success
  1287. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_stone : digsound=success
  1288. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_steel : digsound=success
  1289. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_diamond : digsound=success
  1290. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_mese : digsound=success
  1291. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_stone : digsound=N/A (could not dig)
  1292. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_steel : digsound=N/A (could not dig)
  1293. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_diamond : digsound=N/A (could not dig)
  1294. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_mese : digsound=N/A (could not dig)
  1295. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1296. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_steel : digsound=failure
  1297. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_diamond : digsound=failure
  1298. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_mese : digsound=failure
  1299. --= Tests of Tools Against Modified Groups (B) =--
  1300. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_stone : digsound=N/A (could not dig)
  1301. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_steel : digsound=success
  1302. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_diamond : digsound=success
  1303. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_mese : digsound=success
  1304. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_stone : digsound=success
  1305. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_steel : digsound=success
  1306. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_diamond : digsound=success
  1307. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_mese : digsound=success
  1308. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_stone : digsound=success
  1309. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_steel : digsound=success
  1310. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_diamond : digsound=success
  1311. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_mese : digsound=success
  1312. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1313. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_steel : digsound=failure
  1314. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_diamond : digsound=failure
  1315. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_mese : digsound=failure
  1316. --= Tests of Swords Against Modified Groups (C) =--
  1317. result_of {snappy = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1318. result_of {snappy = 1} + tool=default:sword_steel : digsound=failure
  1319. result_of {snappy = 1} + tool=default:sword_diamond : digsound=failure
  1320. result_of {snappy = 1} + tool=default:sword_mese : digsound=failure
  1321. --]]
  1322. minetest.register_node("default:papyrus", {
  1323. description = "Papyrus",
  1324. drawtype = "plantlike",
  1325. tiles = {"default_papyrus.png"},
  1326. inventory_image = "default_papyrus.png",
  1327. wield_image = "default_papyrus.png",
  1328. paramtype = "light",
  1329. sunlight_propagates = true,
  1330. walkable = false,
  1331. selection_box = {
  1332. type = "fixed",
  1333. fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
  1334. },
  1335. drop = "default:papyrus",
  1336. groups = utility.dig_groups("plant", {flammable = 2, standing_node = 1}),
  1337. sounds = default.node_sound_leaves_defaults(),
  1338. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1339. on_place = function(...)
  1340. return papyrus.on_place(...)
  1341. end,
  1342. on_construct = function(...)
  1343. return papyrus.on_construct(...)
  1344. end,
  1345. on_destruct = function(...)
  1346. return papyrus.on_destruct(...)
  1347. end,
  1348. on_timer = function(...)
  1349. return papyrus.on_timer(...)
  1350. end,
  1351. after_dig_node = function(...)
  1352. return papyrus.after_dig_node(...)
  1353. end,
  1354. })
  1355. -- Hanging version.
  1356. minetest.register_node("default:papyrus2", {
  1357. description = "Hanging Papyrus (You Hacker)",
  1358. drawtype = "plantlike",
  1359. tiles = {"default_papyrus.png"},
  1360. inventory_image = "default_papyrus.png",
  1361. wield_image = "default_papyrus.png",
  1362. paramtype = "light",
  1363. sunlight_propagates = true,
  1364. walkable = false,
  1365. selection_box = {
  1366. type = "fixed",
  1367. fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
  1368. },
  1369. drop = "default:papyrus",
  1370. groups = utility.dig_groups("plant", {flammable = 2, hanging_node = 1}),
  1371. sounds = default.node_sound_leaves_defaults(),
  1372. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1373. -- Note: NOT climbable. Should behave like normal papyrus as close as possible.
  1374. on_collapse_to_entity = function(pos, node)
  1375. return {ItemStack("default:papyrus")}
  1376. end,
  1377. on_finish_collapse = function(pos, node)
  1378. minetest.set_node(pos, {name="default:papyrus"})
  1379. end,
  1380. after_dig_node = function(...)
  1381. return papyrus.after_dig_node_hanging(...)
  1382. end,
  1383. })
  1384. minetest.register_node("default:dry_shrub", {
  1385. description = "Dry Shrub",
  1386. drawtype = "plantlike",
  1387. waving = 1,
  1388. tiles = {"default_dry_shrub.png"},
  1389. inventory_image = "default_dry_shrub.png",
  1390. wield_image = "default_dry_shrub.png",
  1391. paramtype = "light",
  1392. sunlight_propagates = true,
  1393. walkable = false,
  1394. buildable_to = true,
  1395. groups = utility.dig_groups("plant", {
  1396. flammable = 3, attached_node = 1, dry_grass = 1, dry_shrub = 1,
  1397. }),
  1398. sounds = default.node_sound_leaves_defaults(),
  1399. selection_box = {
  1400. type = "fixed",
  1401. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1402. },
  1403. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1404. -- Drop 1 or 2 sticks.
  1405. drop = {
  1406. max_items = 1,
  1407. items = {
  1408. {items = {'default:stick 2'}, rarity = 2},
  1409. {items = {'default:stick'}},
  1410. }
  1411. },
  1412. shears_drop = true,
  1413. flowerpot_drop = "default:dry_shrub",
  1414. })
  1415. minetest.register_node("default:dry_shrub2", {
  1416. description = "Dead Bush",
  1417. drawtype = "plantlike",
  1418. waving = 1,
  1419. tiles = {"default_dry_shrub2.png"},
  1420. inventory_image = "default_dry_shrub2.png",
  1421. wield_image = "default_dry_shrub2.png",
  1422. paramtype = "light",
  1423. paramtype2 = "meshoptions",
  1424. place_param2 = 4,
  1425. sunlight_propagates = true,
  1426. walkable = false,
  1427. buildable_to = true,
  1428. groups = utility.dig_groups("plant", {
  1429. flammable = 3, attached_node = 1, dry_grass = 1, dry_shrub = 1,
  1430. }),
  1431. sounds = default.node_sound_leaves_defaults(),
  1432. selection_box = {
  1433. type = "fixed",
  1434. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 4 / 16, 6 / 16},
  1435. },
  1436. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1437. drop = {
  1438. max_items = 1,
  1439. items = {
  1440. {items = {'default:stick 2'}, rarity = 2},
  1441. {items = {'default:stick'}},
  1442. }
  1443. },
  1444. shears_drop = true,
  1445. flowerpot_drop = "default:dry_shrub2",
  1446. })
  1447. minetest.register_node("default:junglegrass", {
  1448. description = "Jungle Grass",
  1449. drawtype = "plantlike",
  1450. waving = 1,
  1451. visual_scale = 1.69,
  1452. tiles = {"default_junglegrass.png"},
  1453. inventory_image = "default_junglegrass.png",
  1454. wield_image = "default_junglegrass.png",
  1455. paramtype = "light",
  1456. paramtype2 = "meshoptions",
  1457. place_param2 = 2,
  1458. sunlight_propagates = true,
  1459. walkable = false,
  1460. buildable_to = true,
  1461. -- Default drops are defined in farming mod.
  1462. flowerpot_drop = "default:junglegrass",
  1463. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1}),
  1464. sounds = default.node_sound_leaves_defaults(),
  1465. selection_box = {
  1466. type = "fixed",
  1467. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1468. },
  1469. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1470. on_construct = function(...)
  1471. return flowers.on_flora_construct(...)
  1472. end,
  1473. on_destruct = function(...)
  1474. return flowers.on_flora_destruct(...)
  1475. end,
  1476. on_timer = function(...)
  1477. return flowers.on_flora_timer(...)
  1478. end,
  1479. on_punch = function(...)
  1480. return flowers.on_flora_punch(...)
  1481. end,
  1482. })
  1483. minetest.register_node("default:coarsegrass", {
  1484. description = "Coarse Grass",
  1485. drawtype = "plantlike",
  1486. waving = 1,
  1487. tiles = {"default_junglegrass_newstyle.png"},
  1488. inventory_image = "default_junglegrass_newstyle.png",
  1489. wield_image = "default_junglegrass_newstyle.png",
  1490. paramtype = "light",
  1491. paramtype2 = "meshoptions",
  1492. place_param2 = 2,
  1493. sunlight_propagates = true,
  1494. walkable = false,
  1495. buildable_to = true,
  1496. drop = "default:stick",
  1497. shears_drop = true,
  1498. flowerpot_drop = "default:coarsegrass",
  1499. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1}),
  1500. sounds = default.node_sound_leaves_defaults(),
  1501. selection_box = {
  1502. type = "fixed",
  1503. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1504. },
  1505. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1506. on_construct = function(...)
  1507. return flowers.on_flora_construct(...)
  1508. end,
  1509. on_destruct = function(...)
  1510. return flowers.on_flora_destruct(...)
  1511. end,
  1512. on_timer = function(...)
  1513. return flowers.on_flora_timer(...)
  1514. end,
  1515. on_punch = function(...)
  1516. return flowers.on_flora_punch(...)
  1517. end,
  1518. })
  1519. -- This node is not meant to be placed in the world.
  1520. -- Instead, placing it causes 1 of several other nodetypes to be placed instead.
  1521. minetest.register_node("default:grass_dummy", {
  1522. description = "Wild Grass\n\nA common field plant, sometimes containing seeds.\nCan be hung upside down like some herbs.",
  1523. drawtype = "plantlike",
  1524. waving = 1,
  1525. tiles = {"default_grass_1.png"},
  1526. -- Use texture of a taller grass stage in inventory
  1527. inventory_image = "default_grass_3.png",
  1528. wield_image = "default_grass_3.png",
  1529. paramtype = "light",
  1530. paramtype2 = "meshoptions",
  1531. place_param2 = 2,
  1532. sounds = default.node_sound_leaves_defaults(),
  1533. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1534. flowerpot_insert = {"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"},
  1535. -- Zero-width selection box.
  1536. selection_box = {
  1537. type = "fixed",
  1538. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1539. },
  1540. on_place = function(itemstack, placer, pt)
  1541. -- place a random grass node
  1542. -- If pointing to the ceiling place hanging grass.
  1543. --minetest.chat_send_all(dump(pt))
  1544. if pt.type == "node" then
  1545. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1546. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1547. if pt.under.y-1 == pt.above.y then
  1548. --minetest.chat_send_all("hanging!")
  1549. local stack = ItemStack("default:grass_" .. math_random(1,5) .. "_hanging")
  1550. local ret = minetest.item_place(stack, placer, pt)
  1551. return ItemStack("default:grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1552. end
  1553. end
  1554. local stack = ItemStack("default:grass_" .. math_random(1,5))
  1555. local ret = minetest.item_place(stack, placer, pt)
  1556. return ItemStack("default:grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1557. end,
  1558. })
  1559. for i = 1, 5 do
  1560. minetest.register_node("default:grass_" .. i, {
  1561. description = "Grass",
  1562. drawtype = "plantlike",
  1563. waving = 1,
  1564. tiles = {"default_grass_" .. i .. ".png"},
  1565. inventory_image = "default_grass_3.png",
  1566. wield_image = "default_grass_3.png",
  1567. paramtype = "light",
  1568. paramtype2 = "meshoptions",
  1569. place_param2 = 2,
  1570. sunlight_propagates = true,
  1571. walkable = false,
  1572. buildable_to = true,
  1573. -- Default drops are defined in farming mod.
  1574. flowerpot_drop = "default:grass_dummy",
  1575. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1, flammable = 1}),
  1576. sounds = default.node_sound_leaves_defaults(),
  1577. selection_box = {
  1578. type = "fixed",
  1579. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1580. },
  1581. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1582. on_construct = function(...)
  1583. return flowers.on_flora_construct(...)
  1584. end,
  1585. on_destruct = function(...)
  1586. return flowers.on_flora_destruct(...)
  1587. end,
  1588. on_timer = function(...)
  1589. return flowers.on_flora_timer(...)
  1590. end,
  1591. on_punch = function(...)
  1592. return flowers.on_flora_punch(...)
  1593. end,
  1594. })
  1595. end
  1596. for i = 1, 5 do
  1597. minetest.register_node("default:grass_" .. i .. "_hanging", {
  1598. description = "Hanging Grass",
  1599. drawtype = "plantlike",
  1600. -- Waving hanging nodes look ugly.
  1601. --waving = 1,
  1602. tiles = {"default_grass_" .. i .. ".png^[transformFY"},
  1603. inventory_image = "default_grass_3.png",
  1604. wield_image = "default_grass_3.png",
  1605. paramtype = "light",
  1606. paramtype2 = "meshoptions",
  1607. place_param2 = 2,
  1608. sunlight_propagates = true,
  1609. walkable = false,
  1610. buildable_to = true,
  1611. -- Default drops are defined in farming mod.
  1612. flowerpot_drop = "default:grass_dummy",
  1613. groups = utility.dig_groups("plant", {hanging_node = 1, not_in_creative_inventory = 1, grass = 1, flammable = 1}),
  1614. sounds = default.node_sound_leaves_defaults(),
  1615. selection_box = {
  1616. type = "fixed",
  1617. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1618. },
  1619. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1620. })
  1621. end
  1622. minetest.register_node("default:dry_grass_dummy", {
  1623. description = "Dry Grass",
  1624. drawtype = "plantlike",
  1625. waving = 1,
  1626. tiles = {"default_dry_grass_1.png"},
  1627. inventory_image = "default_dry_grass_3.png",
  1628. wield_image = "default_dry_grass_3.png",
  1629. paramtype = "light",
  1630. paramtype2 = "meshoptions",
  1631. place_param2 = 2,
  1632. sounds = default.node_sound_leaves_defaults(),
  1633. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1634. flowerpot_insert = {"default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"},
  1635. -- Zero-width selection box.
  1636. selection_box = {
  1637. type = "fixed",
  1638. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1639. },
  1640. on_place = function(itemstack, placer, pt)
  1641. -- place a random dry grass node
  1642. -- If pointing to the ceiling place hanging grass.
  1643. --minetest.chat_send_all(dump(pt))
  1644. if pt.type == "node" then
  1645. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1646. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1647. if pt.under.y-1 == pt.above.y then
  1648. --minetest.chat_send_all("hanging!")
  1649. local stack = ItemStack("default:dry_grass_" .. math_random(1,5) .. "_hanging")
  1650. local ret = minetest.item_place(stack, placer, pt)
  1651. return ItemStack("default:dry_grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1652. end
  1653. end
  1654. local stack = ItemStack("default:dry_grass_" .. math_random(1, 5))
  1655. local ret = minetest.item_place(stack, placer, pt)
  1656. return ItemStack("default:dry_grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1657. end,
  1658. })
  1659. for i = 1, 5 do
  1660. minetest.register_node("default:dry_grass_" .. i, {
  1661. description = "Dry Grass",
  1662. drawtype = "plantlike",
  1663. waving = 1,
  1664. tiles = {"default_dry_grass_" .. i .. ".png"},
  1665. inventory_image = "default_dry_grass_3.png",
  1666. wield_image = "default_dry_grass_3.png",
  1667. paramtype = "light",
  1668. paramtype2 = "meshoptions",
  1669. place_param2 = 2,
  1670. sunlight_propagates = true,
  1671. walkable = false,
  1672. buildable_to = true,
  1673. groups = utility.dig_groups("plant", {flammable = 3, flora = 1, attached_node = 1,
  1674. not_in_creative_inventory=1, dry_grass = 1}),
  1675. drop = "",
  1676. shears_drop = "default:dry_grass_dummy",
  1677. flowerpot_drop = "default:dry_grass_dummy",
  1678. sounds = default.node_sound_leaves_defaults(),
  1679. selection_box = {
  1680. type = "fixed",
  1681. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1682. },
  1683. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1684. on_construct = function(...)
  1685. return flowers.on_flora_construct(...)
  1686. end,
  1687. on_destruct = function(...)
  1688. return flowers.on_flora_destruct(...)
  1689. end,
  1690. on_timer = function(...)
  1691. return flowers.on_flora_timer(...)
  1692. end,
  1693. on_punch = function(...)
  1694. return flowers.on_flora_punch(...)
  1695. end,
  1696. })
  1697. end
  1698. for i = 1, 5 do
  1699. minetest.register_node("default:dry_grass_" .. i .. "_hanging", {
  1700. description = "Dry Grass",
  1701. drawtype = "plantlike",
  1702. -- Waving hanging grass looks silly.
  1703. --waving = 1,
  1704. tiles = {"default_dry_grass_" .. i .. ".png^[transformFY"},
  1705. inventory_image = "default_dry_grass_3.png",
  1706. wield_image = "default_dry_grass_3.png",
  1707. paramtype = "light",
  1708. paramtype2 = "meshoptions",
  1709. place_param2 = 2,
  1710. sunlight_propagates = true,
  1711. walkable = false,
  1712. buildable_to = true,
  1713. -- Not in flora group, since it does not need to spread.
  1714. groups = utility.dig_groups("plant", {flammable = 3, hanging_node = 1,
  1715. not_in_creative_inventory=1, dry_grass = 1}),
  1716. drop = "",
  1717. shears_drop = "default:dry_grass_dummy",
  1718. flowerpot_drop = "default:dry_grass_dummy",
  1719. sounds = default.node_sound_leaves_defaults(),
  1720. selection_box = {
  1721. type = "fixed",
  1722. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1723. },
  1724. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1725. })
  1726. end
  1727. minetest.register_node("default:dry_grass2_dummy", {
  1728. description = "Dry Grass",
  1729. drawtype = "plantlike",
  1730. waving = 1,
  1731. tiles = {"default_dry_grass2_1.png"},
  1732. inventory_image = "default_dry_grass2_3.png",
  1733. wield_image = "default_dry_grass2_3.png",
  1734. paramtype = "light",
  1735. paramtype2 = "meshoptions",
  1736. place_param2 = 2,
  1737. sounds = default.node_sound_leaves_defaults(),
  1738. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1739. flowerpot_insert = {"default:dry_grass2_1", "default:dry_grass2_2", "default:dry_grass2_3", "default:dry_grass2_4", "default:dry_grass2_5"},
  1740. -- Zero-width selection box.
  1741. selection_box = {
  1742. type = "fixed",
  1743. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1744. },
  1745. on_place = function(itemstack, placer, pt)
  1746. -- place a random dry grass node
  1747. -- If pointing to the ceiling place hanging grass.
  1748. --minetest.chat_send_all(dump(pt))
  1749. if pt.type == "node" then
  1750. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1751. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1752. if pt.under.y-1 == pt.above.y then
  1753. --minetest.chat_send_all("hanging!")
  1754. local stack = ItemStack("default:dry_grass2_" .. math_random(1,5) .. "_hanging")
  1755. local ret = minetest.item_place(stack, placer, pt)
  1756. return ItemStack("default:dry_grass2_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1757. end
  1758. end
  1759. local stack = ItemStack("default:dry_grass2_" .. math_random(1, 5))
  1760. local ret = minetest.item_place(stack, placer, pt)
  1761. return ItemStack("default:dry_grass2_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1762. end,
  1763. })
  1764. for i = 1, 5 do
  1765. minetest.register_node("default:dry_grass2_" .. i, {
  1766. description = "Dry Grass",
  1767. drawtype = "plantlike",
  1768. waving = 1,
  1769. tiles = {"default_dry_grass2_" .. i .. ".png"},
  1770. inventory_image = "default_dry_grass2_3.png",
  1771. wield_image = "default_dry_grass2_3.png",
  1772. paramtype = "light",
  1773. paramtype2 = "meshoptions",
  1774. place_param2 = 2,
  1775. sunlight_propagates = true,
  1776. walkable = false,
  1777. buildable_to = true,
  1778. groups = utility.dig_groups("plant", {flammable = 3, flora = 1, attached_node = 1,
  1779. not_in_creative_inventory=1, dry_grass = 1}),
  1780. drop = "",
  1781. shears_drop = "default:dry_grass2_dummy",
  1782. flowerpot_drop = "default:dry_grass2_dummy",
  1783. sounds = default.node_sound_leaves_defaults(),
  1784. selection_box = {
  1785. type = "fixed",
  1786. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1787. },
  1788. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1789. on_construct = function(...)
  1790. return flowers.on_flora_construct(...)
  1791. end,
  1792. on_destruct = function(...)
  1793. return flowers.on_flora_destruct(...)
  1794. end,
  1795. on_timer = function(...)
  1796. return flowers.on_flora_timer(...)
  1797. end,
  1798. on_punch = function(...)
  1799. return flowers.on_flora_punch(...)
  1800. end,
  1801. })
  1802. end
  1803. for i = 1, 5 do
  1804. minetest.register_node("default:dry_grass2_" .. i .. "_hanging", {
  1805. description = "Dry Grass",
  1806. drawtype = "plantlike",
  1807. -- Waving hanging grass looks silly.
  1808. --waving = 1,
  1809. tiles = {"default_dry_grass2_" .. i .. ".png^[transformFY"},
  1810. inventory_image = "default_dry_grass2_3.png",
  1811. wield_image = "default_dry_grass2_3.png",
  1812. paramtype = "light",
  1813. paramtype2 = "meshoptions",
  1814. place_param2 = 2,
  1815. sunlight_propagates = true,
  1816. walkable = false,
  1817. buildable_to = true,
  1818. -- Not in flora group, since it does not need to spread.
  1819. groups = utility.dig_groups("plant", {flammable = 3, hanging_node = 1,
  1820. not_in_creative_inventory=1, dry_grass = 1}),
  1821. drop = "",
  1822. shears_drop = "default:dry_grass2_dummy",
  1823. flowerpot_drop = "default:dry_grass2_dummy",
  1824. sounds = default.node_sound_leaves_defaults(),
  1825. selection_box = {
  1826. type = "fixed",
  1827. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1828. },
  1829. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1830. })
  1831. end
  1832. --
  1833. -- Liquids
  1834. --
  1835. local function add_steam_particles(p)
  1836. minetest.add_particlespawner({
  1837. amount = 15,
  1838. time = 0.3,
  1839. minpos = {x = p.x - 0.5, y = p.y + 0.5, z = p.z - 0.5 },
  1840. maxpos = {x = p.x + 0.5, y = p.y + 0.5, z = p.z + 0.5 },
  1841. minvel = {x = -0.2, y = 0.3, z = -0.2},
  1842. maxvel = {x = 0.2, y = 0.4, z = 0.2},
  1843. minacc = {x = -0.15, y = -0.02, z = -0.15},
  1844. maxacc = {x = 0.15, y = -0.01, z = 0.15},
  1845. minexptime = 4,
  1846. maxexptime = 6,
  1847. minsize = 3,
  1848. maxsize = 5,
  1849. collisiondetection = true,
  1850. texture = "default_item_smoke.png"
  1851. })
  1852. end
  1853. minetest.register_node("default:water_source", {
  1854. description = "Water Source",
  1855. drawtype = "liquid",
  1856. tiles = {
  1857. {
  1858. name = "default_water_source_animated.png",
  1859. animation = {
  1860. type = "vertical_frames",
  1861. aspect_w = 16,
  1862. aspect_h = 16,
  1863. length = 2.0,
  1864. },
  1865. },
  1866. },
  1867. special_tiles = {
  1868. -- New-style water source material (mostly unused)
  1869. {
  1870. name = "default_water_source_animated.png",
  1871. animation = {
  1872. type = "vertical_frames",
  1873. aspect_w = 16,
  1874. aspect_h = 16,
  1875. length = 2.0,
  1876. },
  1877. backface_culling = false,
  1878. },
  1879. },
  1880. use_texture_alpha = "blend",
  1881. paramtype = "light",
  1882. walkable = false,
  1883. pointable = false,
  1884. diggable = false,
  1885. buildable_to = true,
  1886. is_ground_content = false,
  1887. drop = "",
  1888. drowning = 4,
  1889. liquidtype = "source",
  1890. liquid_alternative_flowing = "default:water_flowing",
  1891. liquid_alternative_source = "default:water_source",
  1892. liquid_viscosity = 1,
  1893. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1894. groups = {water = 3, liquid = 3, puts_out_fire = 1},
  1895. sounds = default.node_sound_water_defaults(),
  1896. -- Water turns to fire in the nether.
  1897. -- Note: this is not called if water-source is created by the engine due to liquid-flow mechanic.
  1898. on_construct = function(pos)
  1899. farming.notify_soil(pos)
  1900. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1901. minetest.add_node(pos, {name="fire:basic_flame"})
  1902. return
  1903. end
  1904. if rc.current_realm_at_pos(pos) == "channelwood" then
  1905. minetest.swap_node(pos, {name="cw:water_source"})
  1906. return
  1907. end
  1908. if pos.y < -25000 or rc.current_realm_at_pos(pos) == "naraxen" then
  1909. ambiance.sound_play("default_cool_lava", pos, 2.0, 16)
  1910. add_steam_particles(pos)
  1911. minetest.add_node(pos, {name="fire:basic_flame"})
  1912. end
  1913. end,
  1914. on_destruct = function(pos)
  1915. farming.notify_soil(pos)
  1916. end,
  1917. on_collapse_to_entity = function(pos, node)
  1918. -- Do not allow player to obtain the node itself.
  1919. end,
  1920. })
  1921. minetest.register_node("default:water_flowing", {
  1922. description = "Flowing Water",
  1923. drawtype = "flowingliquid",
  1924. tiles = {"default_water.png"},
  1925. special_tiles = {
  1926. {
  1927. name = "default_water_flowing_animated.png",
  1928. backface_culling = false,
  1929. animation = {
  1930. type = "vertical_frames",
  1931. aspect_w = 16,
  1932. aspect_h = 16,
  1933. length = 0.8,
  1934. },
  1935. },
  1936. {
  1937. name = "default_water_flowing_animated.png",
  1938. backface_culling = true,
  1939. animation = {
  1940. type = "vertical_frames",
  1941. aspect_w = 16,
  1942. aspect_h = 16,
  1943. length = 0.8,
  1944. },
  1945. },
  1946. },
  1947. use_texture_alpha = "blend",
  1948. paramtype = "light",
  1949. paramtype2 = "flowingliquid",
  1950. walkable = false,
  1951. pointable = false,
  1952. diggable = false,
  1953. buildable_to = true,
  1954. is_ground_content = false,
  1955. drop = "",
  1956. drowning = 4,
  1957. liquidtype = "flowing",
  1958. liquid_alternative_flowing = "default:water_flowing",
  1959. liquid_alternative_source = "default:water_source",
  1960. liquid_viscosity = 1,
  1961. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1962. groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
  1963. sounds = default.node_sound_water_defaults(),
  1964. on_collapse_to_entity = function(pos, node)
  1965. -- Do not allow player to obtain the node itself.
  1966. end,
  1967. on_construct = function(pos)
  1968. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1969. minetest.add_node(pos, {name="fire:basic_flame"})
  1970. return
  1971. end
  1972. if rc.current_realm_at_pos(pos) == "channelwood" then
  1973. minetest.swap_node(pos, {name="cw:water_flowing"})
  1974. return
  1975. end
  1976. if pos.y < -25000 or rc.current_realm_at_pos(pos) == "naraxen" then
  1977. ambiance.sound_play("default_cool_lava", pos, 2.0, 16)
  1978. add_steam_particles(pos)
  1979. minetest.add_node(pos, {name="fire:basic_flame"})
  1980. end
  1981. end,
  1982. })
  1983. minetest.register_node("default:river_water_source", {
  1984. description = "Salt Water Source",
  1985. drawtype = "liquid",
  1986. tiles = {
  1987. {
  1988. name = "default_river_water_source_animated.png",
  1989. animation = {
  1990. type = "vertical_frames",
  1991. aspect_w = 16,
  1992. aspect_h = 16,
  1993. length = 2.0,
  1994. },
  1995. },
  1996. },
  1997. special_tiles = {
  1998. {
  1999. name = "default_river_water_source_animated.png",
  2000. animation = {
  2001. type = "vertical_frames",
  2002. aspect_w = 16,
  2003. aspect_h = 16,
  2004. length = 2.0,
  2005. },
  2006. backface_culling = false,
  2007. },
  2008. },
  2009. use_texture_alpha = "blend",
  2010. paramtype = "light",
  2011. walkable = false,
  2012. pointable = false,
  2013. diggable = false,
  2014. buildable_to = true,
  2015. is_ground_content = false,
  2016. drop = "",
  2017. drowning = 4,
  2018. liquidtype = "source",
  2019. liquid_alternative_flowing = "default:river_water_flowing",
  2020. liquid_alternative_source = "default:river_water_source",
  2021. liquid_viscosity = 1,
  2022. -- River water can be placed above ground, so liquid must NOT be renewable!
  2023. liquid_renewable = false,
  2024. liquid_range = 2,
  2025. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  2026. groups = {water = 3, liquid = 3, puts_out_fire = 1},
  2027. sounds = default.node_sound_water_defaults(),
  2028. -- Water turns to fire in the nether.
  2029. -- Note: this is not called if water-source is created by the engine due to liquid-flow mechanic.
  2030. on_construct = function(pos)
  2031. farming.notify_soil(pos)
  2032. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  2033. minetest.add_node(pos, {name="fire:basic_flame"})
  2034. return
  2035. end
  2036. if pos.y < -25000 or rc.current_realm_at_pos(pos) == "naraxen" then
  2037. ambiance.sound_play("default_cool_lava", pos, 2.0, 16)
  2038. add_steam_particles(pos)
  2039. minetest.add_node(pos, {name="fire:basic_flame"})
  2040. end
  2041. end,
  2042. on_destruct = function(pos)
  2043. farming.notify_soil(pos)
  2044. end,
  2045. on_collapse_to_entity = function(pos, node)
  2046. -- Do not allow player to obtain the node itself.
  2047. end,
  2048. })
  2049. minetest.register_node("default:river_water_flowing", {
  2050. description = "Flowing Salt Water",
  2051. drawtype = "flowingliquid",
  2052. tiles = {"default_river_water.png"},
  2053. special_tiles = {
  2054. {
  2055. name = "default_river_water_flowing_animated.png",
  2056. backface_culling = false,
  2057. animation = {
  2058. type = "vertical_frames",
  2059. aspect_w = 16,
  2060. aspect_h = 16,
  2061. length = 0.8,
  2062. },
  2063. },
  2064. {
  2065. name = "default_river_water_flowing_animated.png",
  2066. backface_culling = true,
  2067. animation = {
  2068. type = "vertical_frames",
  2069. aspect_w = 16,
  2070. aspect_h = 16,
  2071. length = 0.8,
  2072. },
  2073. },
  2074. },
  2075. use_texture_alpha = "blend",
  2076. paramtype = "light",
  2077. paramtype2 = "flowingliquid",
  2078. walkable = false,
  2079. pointable = false,
  2080. diggable = false,
  2081. buildable_to = true,
  2082. is_ground_content = false,
  2083. drop = "",
  2084. drowning = 4,
  2085. liquidtype = "flowing",
  2086. liquid_alternative_flowing = "default:river_water_flowing",
  2087. liquid_alternative_source = "default:river_water_source",
  2088. liquid_viscosity = 1,
  2089. -- River water can be placed above ground, so liquid must NOT be renewable!
  2090. liquid_renewable = false,
  2091. liquid_range = 2,
  2092. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  2093. groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
  2094. sounds = default.node_sound_water_defaults(),
  2095. on_collapse_to_entity = function(pos, node)
  2096. -- Do not allow player to obtain the node itself.
  2097. end,
  2098. on_construct = function(pos)
  2099. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  2100. minetest.set_node(pos, {name="fire:basic_flame"})
  2101. return
  2102. end
  2103. if pos.y < -25000 or rc.current_realm_at_pos(pos) == "naraxen" then
  2104. ambiance.sound_play("default_cool_lava", pos, 2.0, 16)
  2105. add_steam_particles(pos)
  2106. minetest.add_node(pos, {name="fire:basic_flame"})
  2107. end
  2108. end,
  2109. })
  2110. --
  2111. -- Tools / "Advanced" crafting / Non-"natural"
  2112. --
  2113. minetest.register_node("default:ladder_wood", {
  2114. description = "Wooden Ladder",
  2115. drawtype = "signlike",
  2116. tiles = {"default_ladder_wood.png"},
  2117. inventory_image = "default_ladder_wood.png",
  2118. wield_image = "default_ladder_wood.png",
  2119. paramtype = "light",
  2120. paramtype2 = "wallmounted",
  2121. sunlight_propagates = true,
  2122. walkable = false,
  2123. climbable = true,
  2124. is_ground_content = false,
  2125. selection_box = {
  2126. type = "wallmounted",
  2127. --wall_top = = <default>
  2128. --wall_bottom = = <default>
  2129. --wall_side = = <default>
  2130. },
  2131. groups = utility.dig_groups("bigitem", {flammable = 2, ladder=1}),
  2132. legacy_wallmounted = true,
  2133. sounds = default.node_sound_wood_defaults(),
  2134. -- Lava burns wood ladders instantly.
  2135. -- Water rots wood (instantly too, I guess).
  2136. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  2137. floodable = true,
  2138. })
  2139. minetest.register_node("default:ladder_steel", {
  2140. description = "Wrought Iron Ladder",
  2141. drawtype = "signlike",
  2142. tiles = {"default_ladder_steel.png"},
  2143. inventory_image = "default_ladder_steel.png",
  2144. wield_image = "default_ladder_steel.png",
  2145. paramtype = "light",
  2146. paramtype2 = "wallmounted",
  2147. sunlight_propagates = true,
  2148. walkable = false,
  2149. climbable = true,
  2150. is_ground_content = false,
  2151. selection_box = {
  2152. type = "wallmounted",
  2153. --wall_top = = <default>
  2154. --wall_bottom = = <default>
  2155. --wall_side = = <default>
  2156. },
  2157. groups = utility.dig_groups("bigitem", {ladder=1}),
  2158. sounds = default.node_sound_metal_defaults(),
  2159. -- Lava melts metal ladders quickly.
  2160. -- Water rusts them (quickly too, I guess).
  2161. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  2162. floodable = true,
  2163. })
  2164. minetest.register_node(":defauIt:ladder_wood", {
  2165. description = "Wooden Trap Ladder",
  2166. drawtype = "signlike",
  2167. tiles = {"default_ladder_wood.png"},
  2168. inventory_image = "default_ladder_wood.png",
  2169. wield_image = "default_ladder_wood.png",
  2170. paramtype = "light",
  2171. paramtype2 = "wallmounted",
  2172. sunlight_propagates = true,
  2173. walkable = false,
  2174. climbable = false, -- Player drops through.
  2175. is_ground_content = false,
  2176. selection_box = {
  2177. type = "wallmounted",
  2178. --wall_top = = <default>
  2179. --wall_bottom = = <default>
  2180. --wall_side = = <default>
  2181. },
  2182. groups = utility.dig_groups("bigitem", {flammable = 2}),
  2183. sounds = default.node_sound_wood_defaults(),
  2184. -- Lava burns wood ladders instantly.
  2185. -- Water rots wood (instantly too, I guess).
  2186. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  2187. floodable = true,
  2188. })
  2189. minetest.register_node(":defauIt:ladder_steel", {
  2190. description = "Wrought Iron Trap Ladder",
  2191. drawtype = "signlike",
  2192. tiles = {"default_ladder_steel.png"},
  2193. inventory_image = "default_ladder_steel.png",
  2194. wield_image = "default_ladder_steel.png",
  2195. paramtype = "light",
  2196. paramtype2 = "wallmounted",
  2197. sunlight_propagates = true,
  2198. walkable = false,
  2199. climbable = false, -- Player drops through.
  2200. is_ground_content = false,
  2201. selection_box = {
  2202. type = "wallmounted",
  2203. --wall_top = = <default>
  2204. --wall_bottom = = <default>
  2205. --wall_side = = <default>
  2206. },
  2207. groups = utility.dig_groups("bigitem"),
  2208. sounds = default.node_sound_metal_defaults(),
  2209. -- Lava melts metal ladders quickly.
  2210. -- Water rusts them (quickly too, I guess).
  2211. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  2212. floodable = true,
  2213. })
  2214. default.register_fence("default:fence_iron", {
  2215. description = "Wrought Iron Fence",
  2216. texture = "default_fence_iron.png",
  2217. inventory_image = "default_fence_overlay.png^default_fence_iron.png^default_fence_overlay.png^[makealpha:255,126,126",
  2218. wield_image = "default_fence_overlay.png^default_fence_iron.png^default_fence_overlay.png^[makealpha:255,126,126",
  2219. material = "default:steel_ingot",
  2220. groups = utility.dig_groups("fence_metal", {fence = 1}),
  2221. sounds = default.node_sound_metal_defaults()
  2222. })
  2223. default.register_fence("default:fence_bronze", {
  2224. description = "Bronze Fence",
  2225. texture = "default_fence_bronze.png",
  2226. inventory_image = "default_fence_overlay.png^default_fence_bronze.png^default_fence_overlay.png^[makealpha:255,126,126",
  2227. wield_image = "default_fence_overlay.png^default_fence_bronze.png^default_fence_overlay.png^[makealpha:255,126,126",
  2228. material = "default:bronze_ingot",
  2229. groups = utility.dig_groups("fence_metal", {fence = 1}),
  2230. sounds = default.node_sound_metal_defaults()
  2231. })
  2232. default.register_fence("default:fence_wood", {
  2233. description = "Wooden Fence",
  2234. texture = "default_fence_wood.png",
  2235. inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2236. wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2237. material = "default:wood",
  2238. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2239. sounds = default.node_sound_wood_defaults()
  2240. })
  2241. default.register_fence("default:fence_acacia_wood", {
  2242. description = "Acacia Wood Fence",
  2243. texture = "default_fence_acacia_wood.png",
  2244. inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2245. wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2246. material = "default:acacia_wood",
  2247. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2248. sounds = default.node_sound_wood_defaults()
  2249. })
  2250. default.register_fence("default:fence_junglewood", {
  2251. description = "Jungle Wood Fence",
  2252. texture = "default_fence_junglewood.png",
  2253. inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2254. wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2255. material = "default:junglewood",
  2256. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2257. sounds = default.node_sound_wood_defaults()
  2258. })
  2259. default.register_fence("default:fence_pine_wood", {
  2260. description = "Pine Wood Fence",
  2261. texture = "default_fence_pine_wood.png",
  2262. inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2263. wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2264. material = "default:pine_wood",
  2265. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2266. sounds = default.node_sound_wood_defaults()
  2267. })
  2268. default.register_fence("default:fence_aspen_wood", {
  2269. description = "Aspen Wood Fence",
  2270. texture = "default_fence_aspen_wood.png",
  2271. inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2272. wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2273. material = "default:aspen_wood",
  2274. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2275. sounds = default.node_sound_wood_defaults()
  2276. })
  2277. minetest.register_node("default:glass", {
  2278. description = "Glass",
  2279. drawtype = "glasslike_framed_optional",
  2280. tiles = {"default_glass.png", "default_glass_detail.png"},
  2281. paramtype = "light",
  2282. sunlight_propagates = true,
  2283. is_ground_content = false,
  2284. groups = utility.dig_groups("glass", {glass=1}),
  2285. sounds = default.node_sound_glass_defaults(),
  2286. drop = "vessels:glass_fragments",
  2287. silverpick_drop = true,
  2288. })
  2289. minetest.register_node("default:obsidian_glass", {
  2290. description = "Obsidian Glass",
  2291. drawtype = "glasslike_framed_optional",
  2292. tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
  2293. paramtype = "light",
  2294. is_ground_content = false,
  2295. sunlight_propagates = true,
  2296. sounds = default.node_sound_glass_defaults(),
  2297. groups = utility.dig_groups("glass", {glass=1}),
  2298. drop = "default:obsidian_shard",
  2299. silverpick_drop = true,
  2300. node_dig_prediction = "",
  2301. })
  2302. minetest.register_node("default:brick", {
  2303. description = "Brick Block",
  2304. paramtype2 = "facedir",
  2305. place_param2 = 0,
  2306. tiles = {"default_brick.png"},
  2307. is_ground_content = false,
  2308. groups = utility.dig_groups("brick", {brick = 1}),
  2309. sounds = default.node_sound_stone_defaults(),
  2310. })
  2311. minetest.register_node("default:meselamp", {
  2312. description = "Mese Lamp",
  2313. drawtype = "glasslike",
  2314. tiles = {"default_meselamp.png"},
  2315. paramtype = "light",
  2316. sunlight_propagates = true,
  2317. is_ground_content = false,
  2318. groups = utility.dig_groups("glass"),
  2319. sounds = default.node_sound_glass_defaults(),
  2320. light_source = default.LIGHT_MAX-1,
  2321. })
  2322. minetest.register_node("default:lightbox", {
  2323. description = "Light Box",
  2324. drawtype = "glasslike",
  2325. tiles = {"default_lightbox.png"},
  2326. paramtype = "light",
  2327. sunlight_propagates = true,
  2328. is_ground_content = false,
  2329. groups = utility.dig_groups("glass"),
  2330. sounds = default.node_sound_glass_defaults(),
  2331. light_source = default.LIGHT_MAX - 2,
  2332. })