nodes.lua 83 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966
  1. -- mods/default/nodes.lua
  2. -- support for MT game translation.
  3. local S = default.get_translator
  4. --[[ Node name convention:
  5. Although many node names are in combined-word form, the required form for new
  6. node names is words separated by underscores. If both forms are used in written
  7. language (for example pinewood and pine wood) the underscore form should be used.
  8. --]]
  9. --[[ Index:
  10. Stone
  11. -----
  12. (1. Material 2. Cobble variant 3. Brick variant 4. Modified forms)
  13. default:stone
  14. default:cobble
  15. default:stonebrick
  16. default:stone_block
  17. default:mossycobble
  18. default:desert_stone
  19. default:desert_cobble
  20. default:desert_stonebrick
  21. default:desert_stone_block
  22. default:sandstone
  23. default:sandstonebrick
  24. default:sandstone_block
  25. default:desert_sandstone
  26. default:desert_sandstone_brick
  27. default:desert_sandstone_block
  28. default:silver_sandstone
  29. default:silver_sandstone_brick
  30. default:silver_sandstone_block
  31. default:obsidian
  32. default:obsidianbrick
  33. default:obsidian_block
  34. Soft / Non-Stone
  35. ----------------
  36. (1. Material 2. Modified forms)
  37. default:dirt
  38. default:dirt_with_grass
  39. default:dirt_with_grass_footsteps
  40. default:dirt_with_dry_grass
  41. default:dirt_with_snow
  42. default:dirt_with_rainforest_litter
  43. default:dirt_with_coniferous_litter
  44. default:dry_dirt
  45. default:dry_dirt_with_dry_grass
  46. default:permafrost
  47. default:permafrost_with_stones
  48. default:permafrost_with_moss
  49. default:sand
  50. default:desert_sand
  51. default:silver_sand
  52. default:gravel
  53. default:clay
  54. default:snow
  55. default:snowblock
  56. default:ice
  57. default:cave_ice
  58. Trees
  59. -----
  60. (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
  61. default:tree
  62. default:wood
  63. default:leaves
  64. default:sapling
  65. default:apple
  66. default:jungletree
  67. default:junglewood
  68. default:jungleleaves
  69. default:junglesapling
  70. default:emergent_jungle_sapling
  71. default:pine_tree
  72. default:pine_wood
  73. default:pine_needles
  74. default:pine_sapling
  75. default:acacia_tree
  76. default:acacia_wood
  77. default:acacia_leaves
  78. default:acacia_sapling
  79. default:aspen_tree
  80. default:aspen_wood
  81. default:aspen_leaves
  82. default:aspen_sapling
  83. Ores
  84. ----
  85. (1. In stone 2. Blocks)
  86. default:stone_with_coal
  87. default:coalblock
  88. default:stone_with_iron
  89. default:steelblock
  90. default:stone_with_copper
  91. default:copperblock
  92. default:stone_with_tin
  93. default:tinblock
  94. default:bronzeblock
  95. default:stone_with_gold
  96. default:goldblock
  97. default:stone_with_mese
  98. default:mese
  99. default:stone_with_diamond
  100. default:diamondblock
  101. Plantlife
  102. ---------
  103. default:cactus
  104. default:large_cactus_seedling
  105. default:papyrus
  106. default:dry_shrub
  107. default:junglegrass
  108. default:grass_1
  109. default:grass_2
  110. default:grass_3
  111. default:grass_4
  112. default:grass_5
  113. default:dry_grass_1
  114. default:dry_grass_2
  115. default:dry_grass_3
  116. default:dry_grass_4
  117. default:dry_grass_5
  118. default:fern_1
  119. default:fern_2
  120. default:fern_3
  121. default:marram_grass_1
  122. default:marram_grass_2
  123. default:marram_grass_3
  124. default:bush_stem
  125. default:bush_leaves
  126. default:bush_sapling
  127. default:acacia_bush_stem
  128. default:acacia_bush_leaves
  129. default:acacia_bush_sapling
  130. default:pine_bush_stem
  131. default:pine_bush_needles
  132. default:pine_bush_sapling
  133. default:blueberry_bush_leaves_with_berries
  134. default:blueberry_bush_leaves
  135. default:blueberry_bush_sapling
  136. default:sand_with_kelp
  137. Corals
  138. ------
  139. default:coral_green
  140. default:coral_pink
  141. default:coral_cyan
  142. default:coral_brown
  143. default:coral_orange
  144. default:coral_skeleton
  145. Liquids
  146. -------
  147. (1. Source 2. Flowing)
  148. default:water_source
  149. default:water_flowing
  150. default:river_water_source
  151. default:river_water_flowing
  152. default:lava_source
  153. default:lava_flowing
  154. Tools / "Advanced" crafting / Non-"natural"
  155. -------------------------------------------
  156. default:bookshelf
  157. default:sign_wall_wood
  158. default:sign_wall_steel
  159. default:ladder_wood
  160. default:ladder_steel
  161. default:fence_wood
  162. default:fence_acacia_wood
  163. default:fence_junglewood
  164. default:fence_pine_wood
  165. default:fence_aspen_wood
  166. default:fence_rail_wood
  167. default:fence_rail_acacia_wood
  168. default:fence_rail_junglewood
  169. default:fence_rail_pine_wood
  170. default:fence_rail_aspen_wood
  171. default:glass
  172. default:obsidian_glass
  173. default:brick
  174. default:meselamp
  175. default:mese_post_light
  176. default:mese_post_light_acacia_wood
  177. default:mese_post_light_junglewood
  178. default:mese_post_light_pine_wood
  179. default:mese_post_light_aspen_wood
  180. Misc
  181. ----
  182. default:cloud
  183. --]]
  184. -- Required wrapper to allow customization of default.after_place_leaves
  185. local function after_place_leaves(...)
  186. return default.after_place_leaves(...)
  187. end
  188. -- Required wrapper to allow customization of default.grow_sapling
  189. local function grow_sapling(...)
  190. return default.grow_sapling(...)
  191. end
  192. --
  193. -- Stone
  194. --
  195. minetest.register_node("default:stone", {
  196. description = S("Stone"),
  197. tiles = {"default_stone.png"},
  198. groups = {cracky = 3, stone = 1},
  199. drop = "default:cobble",
  200. legacy_mineral = true,
  201. sounds = default.node_sound_stone_defaults(),
  202. })
  203. minetest.register_node("default:cobble", {
  204. description = S("Cobblestone"),
  205. tiles = {"default_cobble.png"},
  206. is_ground_content = false,
  207. groups = {cracky = 3, stone = 2},
  208. sounds = default.node_sound_stone_defaults(),
  209. })
  210. minetest.register_node("default:stonebrick", {
  211. description = S("Stone Brick"),
  212. paramtype2 = "facedir",
  213. place_param2 = 0,
  214. tiles = {"default_stone_brick.png"},
  215. is_ground_content = false,
  216. groups = {cracky = 2, stone = 1},
  217. sounds = default.node_sound_stone_defaults(),
  218. })
  219. minetest.register_node("default:stone_block", {
  220. description = S("Stone Block"),
  221. tiles = {"default_stone_block.png"},
  222. is_ground_content = false,
  223. groups = {cracky = 2, stone = 1},
  224. sounds = default.node_sound_stone_defaults(),
  225. })
  226. minetest.register_node("default:mossycobble", {
  227. description = S("Mossy Cobblestone"),
  228. tiles = {"default_mossycobble.png"},
  229. is_ground_content = false,
  230. groups = {cracky = 3, stone = 1},
  231. sounds = default.node_sound_stone_defaults(),
  232. })
  233. minetest.register_node("default:desert_stone", {
  234. description = S("Desert Stone"),
  235. tiles = {"default_desert_stone.png"},
  236. groups = {cracky = 3, stone = 1},
  237. drop = "default:desert_cobble",
  238. legacy_mineral = true,
  239. sounds = default.node_sound_stone_defaults(),
  240. })
  241. minetest.register_node("default:desert_cobble", {
  242. description = S("Desert Cobblestone"),
  243. tiles = {"default_desert_cobble.png"},
  244. is_ground_content = false,
  245. groups = {cracky = 3, stone = 2},
  246. sounds = default.node_sound_stone_defaults(),
  247. })
  248. minetest.register_node("default:desert_stonebrick", {
  249. description = S("Desert Stone Brick"),
  250. paramtype2 = "facedir",
  251. place_param2 = 0,
  252. tiles = {"default_desert_stone_brick.png"},
  253. is_ground_content = false,
  254. groups = {cracky = 2, stone = 1},
  255. sounds = default.node_sound_stone_defaults(),
  256. })
  257. minetest.register_node("default:desert_stone_block", {
  258. description = S("Desert Stone Block"),
  259. tiles = {"default_desert_stone_block.png"},
  260. is_ground_content = false,
  261. groups = {cracky = 2, stone = 1},
  262. sounds = default.node_sound_stone_defaults(),
  263. })
  264. minetest.register_node("default:sandstone", {
  265. description = S("Sandstone"),
  266. tiles = {"default_sandstone.png"},
  267. groups = {crumbly = 1, cracky = 3},
  268. sounds = default.node_sound_stone_defaults(),
  269. })
  270. minetest.register_node("default:sandstonebrick", {
  271. description = S("Sandstone Brick"),
  272. paramtype2 = "facedir",
  273. place_param2 = 0,
  274. tiles = {"default_sandstone_brick.png"},
  275. is_ground_content = false,
  276. groups = {cracky = 2},
  277. sounds = default.node_sound_stone_defaults(),
  278. })
  279. minetest.register_node("default:sandstone_block", {
  280. description = S("Sandstone Block"),
  281. tiles = {"default_sandstone_block.png"},
  282. is_ground_content = false,
  283. groups = {cracky = 2},
  284. sounds = default.node_sound_stone_defaults(),
  285. })
  286. minetest.register_node("default:desert_sandstone", {
  287. description = S("Desert Sandstone"),
  288. tiles = {"default_desert_sandstone.png"},
  289. groups = {crumbly = 1, cracky = 3},
  290. sounds = default.node_sound_stone_defaults(),
  291. })
  292. minetest.register_node("default:desert_sandstone_brick", {
  293. description = S("Desert Sandstone Brick"),
  294. paramtype2 = "facedir",
  295. place_param2 = 0,
  296. tiles = {"default_desert_sandstone_brick.png"},
  297. is_ground_content = false,
  298. groups = {cracky = 2},
  299. sounds = default.node_sound_stone_defaults(),
  300. })
  301. minetest.register_node("default:desert_sandstone_block", {
  302. description = S("Desert Sandstone Block"),
  303. tiles = {"default_desert_sandstone_block.png"},
  304. is_ground_content = false,
  305. groups = {cracky = 2},
  306. sounds = default.node_sound_stone_defaults(),
  307. })
  308. minetest.register_node("default:silver_sandstone", {
  309. description = S("Silver Sandstone"),
  310. tiles = {"default_silver_sandstone.png"},
  311. groups = {crumbly = 1, cracky = 3},
  312. sounds = default.node_sound_stone_defaults(),
  313. })
  314. minetest.register_node("default:silver_sandstone_brick", {
  315. description = S("Silver Sandstone Brick"),
  316. paramtype2 = "facedir",
  317. place_param2 = 0,
  318. tiles = {"default_silver_sandstone_brick.png"},
  319. is_ground_content = false,
  320. groups = {cracky = 2},
  321. sounds = default.node_sound_stone_defaults(),
  322. })
  323. minetest.register_node("default:silver_sandstone_block", {
  324. description = S("Silver Sandstone Block"),
  325. tiles = {"default_silver_sandstone_block.png"},
  326. is_ground_content = false,
  327. groups = {cracky = 2},
  328. sounds = default.node_sound_stone_defaults(),
  329. })
  330. minetest.register_node("default:obsidian", {
  331. description = S("Obsidian"),
  332. tiles = {"default_obsidian.png"},
  333. sounds = default.node_sound_stone_defaults(),
  334. groups = {cracky = 1, level = 2},
  335. })
  336. minetest.register_node("default:obsidianbrick", {
  337. description = S("Obsidian Brick"),
  338. paramtype2 = "facedir",
  339. place_param2 = 0,
  340. tiles = {"default_obsidian_brick.png"},
  341. is_ground_content = false,
  342. sounds = default.node_sound_stone_defaults(),
  343. groups = {cracky = 1, level = 2},
  344. })
  345. minetest.register_node("default:obsidian_block", {
  346. description = S("Obsidian Block"),
  347. tiles = {"default_obsidian_block.png"},
  348. is_ground_content = false,
  349. sounds = default.node_sound_stone_defaults(),
  350. groups = {cracky = 1, level = 2},
  351. })
  352. --
  353. -- Soft / Non-Stone
  354. --
  355. minetest.register_node("default:dirt", {
  356. description = S("Dirt"),
  357. tiles = {"default_dirt.png"},
  358. groups = {crumbly = 3, soil = 1},
  359. sounds = default.node_sound_dirt_defaults(),
  360. })
  361. minetest.register_node("default:dirt_with_grass", {
  362. description = S("Dirt with Grass"),
  363. tiles = {"default_grass.png", "default_dirt.png",
  364. {name = "default_dirt.png^default_grass_side.png",
  365. tileable_vertical = false}},
  366. groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
  367. drop = "default:dirt",
  368. sounds = default.node_sound_dirt_defaults({
  369. footstep = {name = "default_grass_footstep", gain = 0.25},
  370. }),
  371. })
  372. minetest.register_node("default:dirt_with_grass_footsteps", {
  373. description = S("Dirt with Grass and Footsteps"),
  374. tiles = {"default_grass.png^default_footprint.png", "default_dirt.png",
  375. {name = "default_dirt.png^default_grass_side.png",
  376. tileable_vertical = false}},
  377. groups = {crumbly = 3, soil = 1, not_in_creative_inventory = 1},
  378. drop = "default:dirt",
  379. sounds = default.node_sound_dirt_defaults({
  380. footstep = {name = "default_grass_footstep", gain = 0.25},
  381. }),
  382. })
  383. minetest.register_node("default:dirt_with_dry_grass", {
  384. description = S("Dirt with Savanna Grass"),
  385. tiles = {"default_dry_grass.png",
  386. "default_dirt.png",
  387. {name = "default_dirt.png^default_dry_grass_side.png",
  388. tileable_vertical = false}},
  389. groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
  390. drop = "default:dirt",
  391. sounds = default.node_sound_dirt_defaults({
  392. footstep = {name = "default_grass_footstep", gain = 0.4},
  393. }),
  394. })
  395. minetest.register_node("default:dirt_with_snow", {
  396. description = S("Dirt with Snow"),
  397. tiles = {"default_snow.png", "default_dirt.png",
  398. {name = "default_dirt.png^default_snow_side.png",
  399. tileable_vertical = false}},
  400. groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1, snowy = 1},
  401. drop = "default:dirt",
  402. sounds = default.node_sound_dirt_defaults({
  403. footstep = {name = "default_snow_footstep", gain = 0.2},
  404. }),
  405. })
  406. minetest.register_node("default:dirt_with_rainforest_litter", {
  407. description = S("Dirt with Rainforest Litter"),
  408. tiles = {
  409. "default_rainforest_litter.png",
  410. "default_dirt.png",
  411. {name = "default_dirt.png^default_rainforest_litter_side.png",
  412. tileable_vertical = false}
  413. },
  414. groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
  415. drop = "default:dirt",
  416. sounds = default.node_sound_dirt_defaults({
  417. footstep = {name = "default_grass_footstep", gain = 0.4},
  418. }),
  419. })
  420. minetest.register_node("default:dirt_with_coniferous_litter", {
  421. description = S("Dirt with Coniferous Litter"),
  422. tiles = {
  423. "default_coniferous_litter.png",
  424. "default_dirt.png",
  425. {name = "default_dirt.png^default_coniferous_litter_side.png",
  426. tileable_vertical = false}
  427. },
  428. groups = {crumbly = 3, soil = 1, spreading_dirt_type = 1},
  429. drop = "default:dirt",
  430. sounds = default.node_sound_dirt_defaults({
  431. footstep = {name = "default_grass_footstep", gain = 0.4},
  432. }),
  433. })
  434. minetest.register_node("default:dry_dirt", {
  435. description = S("Savanna Dirt"),
  436. tiles = {"default_dry_dirt.png"},
  437. groups = {crumbly = 3, soil = 1},
  438. sounds = default.node_sound_dirt_defaults(),
  439. })
  440. minetest.register_node("default:dry_dirt_with_dry_grass", {
  441. description = S("Savanna Dirt with Savanna Grass"),
  442. tiles = {"default_dry_grass.png", "default_dry_dirt.png",
  443. {name = "default_dry_dirt.png^default_dry_grass_side.png",
  444. tileable_vertical = false}},
  445. groups = {crumbly = 3, soil = 1},
  446. drop = "default:dry_dirt",
  447. sounds = default.node_sound_dirt_defaults({
  448. footstep = {name = "default_grass_footstep", gain = 0.4},
  449. }),
  450. })
  451. minetest.register_node("default:permafrost", {
  452. description = S("Permafrost"),
  453. tiles = {"default_permafrost.png"},
  454. groups = {cracky = 3},
  455. sounds = default.node_sound_dirt_defaults(),
  456. })
  457. minetest.register_node("default:permafrost_with_stones", {
  458. description = S("Permafrost with Stones"),
  459. tiles = {"default_permafrost.png^default_stones.png",
  460. "default_permafrost.png",
  461. "default_permafrost.png^default_stones_side.png"},
  462. groups = {cracky = 3},
  463. sounds = default.node_sound_gravel_defaults(),
  464. })
  465. minetest.register_node("default:permafrost_with_moss", {
  466. description = S("Permafrost with Moss"),
  467. tiles = {"default_moss.png", "default_permafrost.png",
  468. {name = "default_permafrost.png^default_moss_side.png",
  469. tileable_vertical = false}},
  470. groups = {cracky = 3},
  471. sounds = default.node_sound_dirt_defaults({
  472. footstep = {name = "default_grass_footstep", gain = 0.25},
  473. }),
  474. })
  475. minetest.register_node("default:sand", {
  476. description = S("Sand"),
  477. tiles = {"default_sand.png"},
  478. groups = {crumbly = 3, falling_node = 1, sand = 1},
  479. sounds = default.node_sound_sand_defaults(),
  480. })
  481. minetest.register_node("default:desert_sand", {
  482. description = S("Desert Sand"),
  483. tiles = {"default_desert_sand.png"},
  484. groups = {crumbly = 3, falling_node = 1, sand = 1},
  485. sounds = default.node_sound_sand_defaults(),
  486. })
  487. minetest.register_node("default:silver_sand", {
  488. description = S("Silver Sand"),
  489. tiles = {"default_silver_sand.png"},
  490. groups = {crumbly = 3, falling_node = 1, sand = 1},
  491. sounds = default.node_sound_sand_defaults(),
  492. })
  493. minetest.register_node("default:gravel", {
  494. description = S("Gravel"),
  495. tiles = {"default_gravel.png"},
  496. groups = {crumbly = 2, falling_node = 1},
  497. sounds = default.node_sound_gravel_defaults(),
  498. drop = {
  499. max_items = 1,
  500. items = {
  501. {items = {"default:flint"}, rarity = 16},
  502. {items = {"default:gravel"}}
  503. }
  504. }
  505. })
  506. minetest.register_node("default:clay", {
  507. description = S("Clay"),
  508. tiles = {"default_clay.png"},
  509. groups = {crumbly = 3},
  510. drop = "default:clay_lump 4",
  511. sounds = default.node_sound_dirt_defaults(),
  512. })
  513. minetest.register_node("default:snow", {
  514. description = S("Snow"),
  515. tiles = {"default_snow.png"},
  516. inventory_image = "default_snowball.png",
  517. wield_image = "default_snowball.png",
  518. paramtype = "light",
  519. buildable_to = true,
  520. floodable = true,
  521. drawtype = "nodebox",
  522. node_box = {
  523. type = "fixed",
  524. fixed = {
  525. {-0.5, -0.5, -0.5, 0.5, -0.25, 0.5},
  526. },
  527. },
  528. collision_box = {
  529. type = "fixed",
  530. fixed = {
  531. {-0.5, -0.5, -0.5, 0.5, -6 / 16, 0.5},
  532. },
  533. },
  534. groups = {crumbly = 3, falling_node = 1, snowy = 1},
  535. sounds = default.node_sound_snow_defaults(),
  536. on_construct = function(pos)
  537. pos.y = pos.y - 1
  538. if minetest.get_node(pos).name == "default:dirt_with_grass" then
  539. minetest.set_node(pos, {name = "default:dirt_with_snow"})
  540. end
  541. end,
  542. })
  543. minetest.register_node("default:snowblock", {
  544. description = S("Snow Block"),
  545. tiles = {"default_snow.png"},
  546. groups = {crumbly = 3, cools_lava = 1, snowy = 1},
  547. sounds = default.node_sound_snow_defaults(),
  548. on_construct = function(pos)
  549. pos.y = pos.y - 1
  550. if minetest.get_node(pos).name == "default:dirt_with_grass" then
  551. minetest.set_node(pos, {name = "default:dirt_with_snow"})
  552. end
  553. end,
  554. })
  555. -- 'is ground content = false' to avoid tunnels in sea ice or ice rivers
  556. minetest.register_node("default:ice", {
  557. description = S("Ice"),
  558. tiles = {"default_ice.png"},
  559. is_ground_content = false,
  560. paramtype = "light",
  561. groups = {cracky = 3, cools_lava = 1, slippery = 3},
  562. sounds = default.node_sound_ice_defaults(),
  563. })
  564. -- Mapgen-placed ice with 'is ground content = true' to contain tunnels
  565. minetest.register_node("default:cave_ice", {
  566. description = S("Cave Ice"),
  567. tiles = {"default_ice.png"},
  568. paramtype = "light",
  569. groups = {cracky = 3, cools_lava = 1, slippery = 3,
  570. not_in_creative_inventory = 1},
  571. drop = "default:ice",
  572. sounds = default.node_sound_ice_defaults(),
  573. })
  574. --
  575. -- Trees
  576. --
  577. minetest.register_node("default:tree", {
  578. description = S("Apple Tree"),
  579. tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"},
  580. paramtype2 = "facedir",
  581. is_ground_content = false,
  582. groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  583. sounds = default.node_sound_wood_defaults(),
  584. on_place = minetest.rotate_node
  585. })
  586. minetest.register_node("default:wood", {
  587. description = S("Apple Wood Planks"),
  588. paramtype2 = "facedir",
  589. place_param2 = 0,
  590. tiles = {"default_wood.png"},
  591. is_ground_content = false,
  592. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
  593. sounds = default.node_sound_wood_defaults(),
  594. })
  595. minetest.register_node("default:sapling", {
  596. description = S("Apple Tree Sapling"),
  597. drawtype = "plantlike",
  598. tiles = {"default_sapling.png"},
  599. inventory_image = "default_sapling.png",
  600. wield_image = "default_sapling.png",
  601. paramtype = "light",
  602. sunlight_propagates = true,
  603. walkable = false,
  604. on_timer = grow_sapling,
  605. selection_box = {
  606. type = "fixed",
  607. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
  608. },
  609. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  610. attached_node = 1, sapling = 1},
  611. sounds = default.node_sound_leaves_defaults(),
  612. on_construct = function(pos)
  613. minetest.get_node_timer(pos):start(math.random(300, 1500))
  614. end,
  615. on_place = function(itemstack, placer, pointed_thing)
  616. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  617. "default:sapling",
  618. -- minp, maxp to be checked, relative to sapling pos
  619. -- minp_relative.y = 1 because sapling pos has been checked
  620. {x = -3, y = 1, z = -3},
  621. {x = 3, y = 6, z = 3},
  622. -- maximum interval of interior volume check
  623. 4)
  624. return itemstack
  625. end,
  626. })
  627. minetest.register_node("default:leaves", {
  628. description = S("Apple Tree Leaves"),
  629. drawtype = "allfaces_optional",
  630. waving = 1,
  631. tiles = {"default_leaves.png"},
  632. special_tiles = {"default_leaves_simple.png"},
  633. paramtype = "light",
  634. is_ground_content = false,
  635. groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
  636. drop = {
  637. max_items = 1,
  638. items = {
  639. {
  640. -- player will get sapling with 1/20 chance
  641. items = {"default:sapling"},
  642. rarity = 20,
  643. },
  644. {
  645. -- player will get leaves only if he get no saplings,
  646. -- this is because max_items is 1
  647. items = {"default:leaves"},
  648. }
  649. }
  650. },
  651. sounds = default.node_sound_leaves_defaults(),
  652. after_place_node = after_place_leaves,
  653. })
  654. minetest.register_node("default:apple", {
  655. description = S("Apple"),
  656. drawtype = "plantlike",
  657. tiles = {"default_apple.png"},
  658. inventory_image = "default_apple.png",
  659. paramtype = "light",
  660. sunlight_propagates = true,
  661. walkable = false,
  662. is_ground_content = false,
  663. selection_box = {
  664. type = "fixed",
  665. fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
  666. },
  667. groups = {fleshy = 3, dig_immediate = 3, flammable = 2,
  668. leafdecay = 3, leafdecay_drop = 1, food_apple = 1},
  669. on_use = minetest.item_eat(2),
  670. sounds = default.node_sound_leaves_defaults(),
  671. after_place_node = function(pos, placer, itemstack)
  672. minetest.set_node(pos, {name = "default:apple", param2 = 1})
  673. end,
  674. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  675. if oldnode.param2 == 0 then
  676. minetest.set_node(pos, {name = "default:apple_mark"})
  677. minetest.get_node_timer(pos):start(math.random(300, 1500))
  678. end
  679. end,
  680. })
  681. minetest.register_node("default:apple_mark", {
  682. description = S("Apple Marker"),
  683. inventory_image = "default_apple.png^default_invisible_node_overlay.png",
  684. wield_image = "default_apple.png^default_invisible_node_overlay.png",
  685. drawtype = "airlike",
  686. paramtype = "light",
  687. sunlight_propagates = true,
  688. walkable = false,
  689. pointable = false,
  690. diggable = false,
  691. buildable_to = true,
  692. drop = "",
  693. groups = {not_in_creative_inventory = 1},
  694. on_timer = function(pos, elapsed)
  695. if not minetest.find_node_near(pos, 1, "default:leaves") then
  696. minetest.remove_node(pos)
  697. elseif minetest.get_node_light(pos) < 11 then
  698. minetest.get_node_timer(pos):start(200)
  699. else
  700. minetest.set_node(pos, {name = "default:apple"})
  701. end
  702. end
  703. })
  704. minetest.register_node("default:jungletree", {
  705. description = S("Jungle Tree"),
  706. tiles = {"default_jungletree_top.png", "default_jungletree_top.png",
  707. "default_jungletree.png"},
  708. paramtype2 = "facedir",
  709. is_ground_content = false,
  710. groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  711. sounds = default.node_sound_wood_defaults(),
  712. on_place = minetest.rotate_node
  713. })
  714. minetest.register_node("default:junglewood", {
  715. description = S("Jungle Wood Planks"),
  716. paramtype2 = "facedir",
  717. place_param2 = 0,
  718. tiles = {"default_junglewood.png"},
  719. is_ground_content = false,
  720. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
  721. sounds = default.node_sound_wood_defaults(),
  722. })
  723. minetest.register_node("default:jungleleaves", {
  724. description = S("Jungle Tree Leaves"),
  725. drawtype = "allfaces_optional",
  726. waving = 1,
  727. tiles = {"default_jungleleaves.png"},
  728. special_tiles = {"default_jungleleaves_simple.png"},
  729. paramtype = "light",
  730. is_ground_content = false,
  731. groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
  732. drop = {
  733. max_items = 1,
  734. items = {
  735. {items = {"default:junglesapling"}, rarity = 20},
  736. {items = {"default:jungleleaves"}}
  737. }
  738. },
  739. sounds = default.node_sound_leaves_defaults(),
  740. after_place_node = after_place_leaves,
  741. })
  742. minetest.register_node("default:junglesapling", {
  743. description = S("Jungle Tree Sapling"),
  744. drawtype = "plantlike",
  745. tiles = {"default_junglesapling.png"},
  746. inventory_image = "default_junglesapling.png",
  747. wield_image = "default_junglesapling.png",
  748. paramtype = "light",
  749. sunlight_propagates = true,
  750. walkable = false,
  751. on_timer = grow_sapling,
  752. selection_box = {
  753. type = "fixed",
  754. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
  755. },
  756. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  757. attached_node = 1, sapling = 1},
  758. sounds = default.node_sound_leaves_defaults(),
  759. on_construct = function(pos)
  760. minetest.get_node_timer(pos):start(math.random(300, 1500))
  761. end,
  762. on_place = function(itemstack, placer, pointed_thing)
  763. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  764. "default:junglesapling",
  765. -- minp, maxp to be checked, relative to sapling pos
  766. -- minp_relative.y = 1 because sapling pos has been checked
  767. {x = -2, y = 1, z = -2},
  768. {x = 2, y = 15, z = 2},
  769. -- maximum interval of interior volume check
  770. 4)
  771. return itemstack
  772. end,
  773. })
  774. minetest.register_node("default:emergent_jungle_sapling", {
  775. description = S("Emergent Jungle Tree Sapling"),
  776. drawtype = "plantlike",
  777. tiles = {"default_emergent_jungle_sapling.png"},
  778. inventory_image = "default_emergent_jungle_sapling.png",
  779. wield_image = "default_emergent_jungle_sapling.png",
  780. paramtype = "light",
  781. sunlight_propagates = true,
  782. walkable = false,
  783. on_timer = grow_sapling,
  784. selection_box = {
  785. type = "fixed",
  786. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
  787. },
  788. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  789. attached_node = 1, sapling = 1},
  790. sounds = default.node_sound_leaves_defaults(),
  791. on_construct = function(pos)
  792. minetest.get_node_timer(pos):start(math.random(300, 1500))
  793. end,
  794. on_place = function(itemstack, placer, pointed_thing)
  795. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  796. "default:emergent_jungle_sapling",
  797. -- minp, maxp to be checked, relative to sapling pos
  798. {x = -3, y = -5, z = -3},
  799. {x = 3, y = 31, z = 3},
  800. -- maximum interval of interior volume check
  801. 4)
  802. return itemstack
  803. end,
  804. })
  805. minetest.register_node("default:pine_tree", {
  806. description = S("Pine Tree"),
  807. tiles = {"default_pine_tree_top.png", "default_pine_tree_top.png",
  808. "default_pine_tree.png"},
  809. paramtype2 = "facedir",
  810. is_ground_content = false,
  811. groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
  812. sounds = default.node_sound_wood_defaults(),
  813. on_place = minetest.rotate_node
  814. })
  815. minetest.register_node("default:pine_wood", {
  816. description = S("Pine Wood Planks"),
  817. paramtype2 = "facedir",
  818. place_param2 = 0,
  819. tiles = {"default_pine_wood.png"},
  820. is_ground_content = false,
  821. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
  822. sounds = default.node_sound_wood_defaults(),
  823. })
  824. minetest.register_node("default:pine_needles",{
  825. description = S("Pine Needles"),
  826. drawtype = "allfaces_optional",
  827. tiles = {"default_pine_needles.png"},
  828. waving = 1,
  829. paramtype = "light",
  830. is_ground_content = false,
  831. groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
  832. drop = {
  833. max_items = 1,
  834. items = {
  835. {items = {"default:pine_sapling"}, rarity = 20},
  836. {items = {"default:pine_needles"}}
  837. }
  838. },
  839. sounds = default.node_sound_leaves_defaults(),
  840. after_place_node = after_place_leaves,
  841. })
  842. minetest.register_node("default:pine_sapling", {
  843. description = S("Pine Tree Sapling"),
  844. drawtype = "plantlike",
  845. tiles = {"default_pine_sapling.png"},
  846. inventory_image = "default_pine_sapling.png",
  847. wield_image = "default_pine_sapling.png",
  848. paramtype = "light",
  849. sunlight_propagates = true,
  850. walkable = false,
  851. on_timer = grow_sapling,
  852. selection_box = {
  853. type = "fixed",
  854. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
  855. },
  856. groups = {snappy = 2, dig_immediate = 3, flammable = 3,
  857. attached_node = 1, sapling = 1},
  858. sounds = default.node_sound_leaves_defaults(),
  859. on_construct = function(pos)
  860. minetest.get_node_timer(pos):start(math.random(300, 1500))
  861. end,
  862. on_place = function(itemstack, placer, pointed_thing)
  863. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  864. "default:pine_sapling",
  865. -- minp, maxp to be checked, relative to sapling pos
  866. -- minp_relative.y = 1 because sapling pos has been checked
  867. {x = -2, y = 1, z = -2},
  868. {x = 2, y = 14, z = 2},
  869. -- maximum interval of interior volume check
  870. 4)
  871. return itemstack
  872. end,
  873. })
  874. minetest.register_node("default:acacia_tree", {
  875. description = S("Acacia Tree"),
  876. tiles = {"default_acacia_tree_top.png", "default_acacia_tree_top.png",
  877. "default_acacia_tree.png"},
  878. paramtype2 = "facedir",
  879. is_ground_content = false,
  880. groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  881. sounds = default.node_sound_wood_defaults(),
  882. on_place = minetest.rotate_node
  883. })
  884. minetest.register_node("default:acacia_wood", {
  885. description = S("Acacia Wood Planks"),
  886. paramtype2 = "facedir",
  887. place_param2 = 0,
  888. tiles = {"default_acacia_wood.png"},
  889. is_ground_content = false,
  890. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1},
  891. sounds = default.node_sound_wood_defaults(),
  892. })
  893. minetest.register_node("default:acacia_leaves", {
  894. description = S("Acacia Tree Leaves"),
  895. drawtype = "allfaces_optional",
  896. tiles = {"default_acacia_leaves.png"},
  897. special_tiles = {"default_acacia_leaves_simple.png"},
  898. waving = 1,
  899. paramtype = "light",
  900. is_ground_content = false,
  901. groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
  902. drop = {
  903. max_items = 1,
  904. items = {
  905. {items = {"default:acacia_sapling"}, rarity = 20},
  906. {items = {"default:acacia_leaves"}}
  907. }
  908. },
  909. sounds = default.node_sound_leaves_defaults(),
  910. after_place_node = after_place_leaves,
  911. })
  912. minetest.register_node("default:acacia_sapling", {
  913. description = S("Acacia Tree Sapling"),
  914. drawtype = "plantlike",
  915. tiles = {"default_acacia_sapling.png"},
  916. inventory_image = "default_acacia_sapling.png",
  917. wield_image = "default_acacia_sapling.png",
  918. paramtype = "light",
  919. sunlight_propagates = true,
  920. walkable = false,
  921. on_timer = grow_sapling,
  922. selection_box = {
  923. type = "fixed",
  924. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
  925. },
  926. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  927. attached_node = 1, sapling = 1},
  928. sounds = default.node_sound_leaves_defaults(),
  929. on_construct = function(pos)
  930. minetest.get_node_timer(pos):start(math.random(300, 1500))
  931. end,
  932. on_place = function(itemstack, placer, pointed_thing)
  933. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  934. "default:acacia_sapling",
  935. -- minp, maxp to be checked, relative to sapling pos
  936. -- minp_relative.y = 1 because sapling pos has been checked
  937. {x = -4, y = 1, z = -4},
  938. {x = 4, y = 7, z = 4},
  939. -- maximum interval of interior volume check
  940. 4)
  941. return itemstack
  942. end,
  943. })
  944. minetest.register_node("default:aspen_tree", {
  945. description = S("Aspen Tree"),
  946. tiles = {"default_aspen_tree_top.png", "default_aspen_tree_top.png",
  947. "default_aspen_tree.png"},
  948. paramtype2 = "facedir",
  949. is_ground_content = false,
  950. groups = {tree = 1, choppy = 3, oddly_breakable_by_hand = 1, flammable = 3},
  951. sounds = default.node_sound_wood_defaults(),
  952. on_place = minetest.rotate_node
  953. })
  954. minetest.register_node("default:aspen_wood", {
  955. description = S("Aspen Wood Planks"),
  956. paramtype2 = "facedir",
  957. place_param2 = 0,
  958. tiles = {"default_aspen_wood.png"},
  959. is_ground_content = false,
  960. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3, wood = 1},
  961. sounds = default.node_sound_wood_defaults(),
  962. })
  963. minetest.register_node("default:aspen_leaves", {
  964. description = S("Aspen Tree Leaves"),
  965. drawtype = "allfaces_optional",
  966. tiles = {"default_aspen_leaves.png"},
  967. waving = 1,
  968. paramtype = "light",
  969. is_ground_content = false,
  970. groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1},
  971. drop = {
  972. max_items = 1,
  973. items = {
  974. {items = {"default:aspen_sapling"}, rarity = 20},
  975. {items = {"default:aspen_leaves"}}
  976. }
  977. },
  978. sounds = default.node_sound_leaves_defaults(),
  979. after_place_node = after_place_leaves,
  980. })
  981. minetest.register_node("default:aspen_sapling", {
  982. description = S("Aspen Tree Sapling"),
  983. drawtype = "plantlike",
  984. tiles = {"default_aspen_sapling.png"},
  985. inventory_image = "default_aspen_sapling.png",
  986. wield_image = "default_aspen_sapling.png",
  987. paramtype = "light",
  988. sunlight_propagates = true,
  989. walkable = false,
  990. on_timer = grow_sapling,
  991. selection_box = {
  992. type = "fixed",
  993. fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 0.5, 3 / 16}
  994. },
  995. groups = {snappy = 2, dig_immediate = 3, flammable = 3,
  996. attached_node = 1, sapling = 1},
  997. sounds = default.node_sound_leaves_defaults(),
  998. on_construct = function(pos)
  999. minetest.get_node_timer(pos):start(math.random(300, 1500))
  1000. end,
  1001. on_place = function(itemstack, placer, pointed_thing)
  1002. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  1003. "default:aspen_sapling",
  1004. -- minp, maxp to be checked, relative to sapling pos
  1005. -- minp_relative.y = 1 because sapling pos has been checked
  1006. {x = -2, y = 1, z = -2},
  1007. {x = 2, y = 12, z = 2},
  1008. -- maximum interval of interior volume check
  1009. 4)
  1010. return itemstack
  1011. end,
  1012. })
  1013. --
  1014. -- Ores
  1015. --
  1016. minetest.register_node("default:stone_with_coal", {
  1017. description = S("Coal Ore"),
  1018. tiles = {"default_stone.png^default_mineral_coal.png"},
  1019. groups = {cracky = 3},
  1020. drop = "default:coal_lump",
  1021. sounds = default.node_sound_stone_defaults(),
  1022. })
  1023. minetest.register_node("default:coalblock", {
  1024. description = S("Coal Block"),
  1025. tiles = {"default_coal_block.png"},
  1026. is_ground_content = false,
  1027. groups = {cracky = 3},
  1028. sounds = default.node_sound_stone_defaults(),
  1029. })
  1030. minetest.register_node("default:stone_with_iron", {
  1031. description = S("Iron Ore"),
  1032. tiles = {"default_stone.png^default_mineral_iron.png"},
  1033. groups = {cracky = 2},
  1034. drop = "default:iron_lump",
  1035. sounds = default.node_sound_stone_defaults(),
  1036. })
  1037. minetest.register_node("default:steelblock", {
  1038. description = S("Steel Block"),
  1039. tiles = {"default_steel_block.png"},
  1040. is_ground_content = false,
  1041. groups = {cracky = 1, level = 2},
  1042. sounds = default.node_sound_metal_defaults(),
  1043. })
  1044. minetest.register_node("default:stone_with_copper", {
  1045. description = S("Copper Ore"),
  1046. tiles = {"default_stone.png^default_mineral_copper.png"},
  1047. groups = {cracky = 2},
  1048. drop = "default:copper_lump",
  1049. sounds = default.node_sound_stone_defaults(),
  1050. })
  1051. minetest.register_node("default:copperblock", {
  1052. description = S("Copper Block"),
  1053. tiles = {"default_copper_block.png"},
  1054. is_ground_content = false,
  1055. groups = {cracky = 1, level = 2},
  1056. sounds = default.node_sound_metal_defaults(),
  1057. })
  1058. minetest.register_node("default:stone_with_tin", {
  1059. description = S("Tin Ore"),
  1060. tiles = {"default_stone.png^default_mineral_tin.png"},
  1061. groups = {cracky = 2},
  1062. drop = "default:tin_lump",
  1063. sounds = default.node_sound_stone_defaults(),
  1064. })
  1065. minetest.register_node("default:tinblock", {
  1066. description = S("Tin Block"),
  1067. tiles = {"default_tin_block.png"},
  1068. is_ground_content = false,
  1069. groups = {cracky = 1, level = 2},
  1070. sounds = default.node_sound_metal_defaults(),
  1071. })
  1072. minetest.register_node("default:bronzeblock", {
  1073. description = S("Bronze Block"),
  1074. tiles = {"default_bronze_block.png"},
  1075. is_ground_content = false,
  1076. groups = {cracky = 1, level = 2},
  1077. sounds = default.node_sound_metal_defaults(),
  1078. })
  1079. minetest.register_node("default:stone_with_mese", {
  1080. description = S("Mese Ore"),
  1081. tiles = {"default_stone.png^default_mineral_mese.png"},
  1082. groups = {cracky = 1},
  1083. drop = "default:mese_crystal",
  1084. sounds = default.node_sound_stone_defaults(),
  1085. })
  1086. minetest.register_node("default:mese", {
  1087. description = S("Mese Block"),
  1088. tiles = {"default_mese_block.png"},
  1089. paramtype = "light",
  1090. groups = {cracky = 1, level = 2},
  1091. sounds = default.node_sound_stone_defaults(),
  1092. light_source = 3,
  1093. })
  1094. minetest.register_node("default:stone_with_gold", {
  1095. description = S("Gold Ore"),
  1096. tiles = {"default_stone.png^default_mineral_gold.png"},
  1097. groups = {cracky = 2},
  1098. drop = "default:gold_lump",
  1099. sounds = default.node_sound_stone_defaults(),
  1100. })
  1101. minetest.register_node("default:goldblock", {
  1102. description = S("Gold Block"),
  1103. tiles = {"default_gold_block.png"},
  1104. is_ground_content = false,
  1105. groups = {cracky = 1},
  1106. sounds = default.node_sound_metal_defaults(),
  1107. })
  1108. minetest.register_node("default:stone_with_diamond", {
  1109. description = S("Diamond Ore"),
  1110. tiles = {"default_stone.png^default_mineral_diamond.png"},
  1111. groups = {cracky = 1},
  1112. drop = "default:diamond",
  1113. sounds = default.node_sound_stone_defaults(),
  1114. })
  1115. minetest.register_node("default:diamondblock", {
  1116. description = S("Diamond Block"),
  1117. tiles = {"default_diamond_block.png"},
  1118. is_ground_content = false,
  1119. groups = {cracky = 1, level = 3},
  1120. sounds = default.node_sound_stone_defaults(),
  1121. })
  1122. --
  1123. -- Plantlife (non-cubic)
  1124. --
  1125. minetest.register_node("default:cactus", {
  1126. description = S("Cactus"),
  1127. tiles = {"default_cactus_top.png", "default_cactus_top.png",
  1128. "default_cactus_side.png"},
  1129. paramtype2 = "facedir",
  1130. groups = {choppy = 3},
  1131. sounds = default.node_sound_wood_defaults(),
  1132. on_place = minetest.rotate_node,
  1133. })
  1134. minetest.register_node("default:large_cactus_seedling", {
  1135. description = S("Large Cactus Seedling"),
  1136. drawtype = "plantlike",
  1137. tiles = {"default_large_cactus_seedling.png"},
  1138. inventory_image = "default_large_cactus_seedling.png",
  1139. wield_image = "default_large_cactus_seedling.png",
  1140. paramtype = "light",
  1141. sunlight_propagates = true,
  1142. walkable = false,
  1143. selection_box = {
  1144. type = "fixed",
  1145. fixed = {
  1146. -5 / 16, -0.5, -5 / 16,
  1147. 5 / 16, 0.5, 5 / 16
  1148. }
  1149. },
  1150. groups = {choppy = 3, dig_immediate = 3, attached_node = 1},
  1151. sounds = default.node_sound_wood_defaults(),
  1152. on_place = function(itemstack, placer, pointed_thing)
  1153. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  1154. "default:large_cactus_seedling",
  1155. {x = -2, y = -1, z = -2},
  1156. {x = 2, y = 5, z = 2},
  1157. 4)
  1158. return itemstack
  1159. end,
  1160. on_construct = function(pos)
  1161. -- Normal cactus farming adds 1 cactus node by ABM,
  1162. -- interval 12s, chance 83.
  1163. -- Consider starting with 5 cactus nodes. We make sure that growing a
  1164. -- large cactus is not a faster way to produce new cactus nodes.
  1165. -- Confirmed by experiment, when farming 5 cacti, on average 1 new
  1166. -- cactus node is added on average every
  1167. -- 83 / 5 = 16.6 intervals = 16.6 * 12 = 199.2s.
  1168. -- Large cactus contains on average 14 cactus nodes.
  1169. -- 14 * 199.2 = 2788.8s.
  1170. -- Set random range to average to 2789s.
  1171. minetest.get_node_timer(pos):start(math.random(1859, 3719))
  1172. end,
  1173. on_timer = function(pos)
  1174. local node_under = minetest.get_node_or_nil(
  1175. {x = pos.x, y = pos.y - 1, z = pos.z})
  1176. if not node_under then
  1177. -- Node under not yet loaded, try later
  1178. minetest.get_node_timer(pos):start(300)
  1179. return
  1180. end
  1181. if minetest.get_item_group(node_under.name, "sand") == 0 then
  1182. -- Seedling dies
  1183. minetest.remove_node(pos)
  1184. return
  1185. end
  1186. local light_level = minetest.get_node_light(pos)
  1187. if not light_level or light_level < 13 then
  1188. -- Too dark for growth, try later in case it's night
  1189. minetest.get_node_timer(pos):start(300)
  1190. return
  1191. end
  1192. minetest.log("action", "A large cactus seedling grows into a large" ..
  1193. "cactus at ".. minetest.pos_to_string(pos))
  1194. default.grow_large_cactus(pos)
  1195. end,
  1196. })
  1197. minetest.register_node("default:papyrus", {
  1198. description = S("Papyrus"),
  1199. drawtype = "plantlike",
  1200. tiles = {"default_papyrus.png"},
  1201. inventory_image = "default_papyrus.png",
  1202. wield_image = "default_papyrus.png",
  1203. paramtype = "light",
  1204. sunlight_propagates = true,
  1205. walkable = false,
  1206. selection_box = {
  1207. type = "fixed",
  1208. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
  1209. },
  1210. groups = {snappy = 3, flammable = 2},
  1211. sounds = default.node_sound_leaves_defaults(),
  1212. after_dig_node = function(pos, node, metadata, digger)
  1213. default.dig_up(pos, node, digger)
  1214. end,
  1215. })
  1216. minetest.register_node("default:dry_shrub", {
  1217. description = S("Dry Shrub"),
  1218. drawtype = "plantlike",
  1219. waving = 1,
  1220. tiles = {"default_dry_shrub.png"},
  1221. inventory_image = "default_dry_shrub.png",
  1222. wield_image = "default_dry_shrub.png",
  1223. paramtype = "light",
  1224. paramtype2 = "meshoptions",
  1225. place_param2 = 4,
  1226. sunlight_propagates = true,
  1227. walkable = false,
  1228. buildable_to = true,
  1229. groups = {snappy = 3, flammable = 3, attached_node = 1},
  1230. sounds = default.node_sound_leaves_defaults(),
  1231. selection_box = {
  1232. type = "fixed",
  1233. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 4 / 16, 6 / 16},
  1234. },
  1235. })
  1236. minetest.register_node("default:junglegrass", {
  1237. description = S("Jungle Grass"),
  1238. drawtype = "plantlike",
  1239. waving = 1,
  1240. visual_scale = 1.69,
  1241. tiles = {"default_junglegrass.png"},
  1242. inventory_image = "default_junglegrass.png",
  1243. wield_image = "default_junglegrass.png",
  1244. paramtype = "light",
  1245. sunlight_propagates = true,
  1246. walkable = false,
  1247. buildable_to = true,
  1248. groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1},
  1249. sounds = default.node_sound_leaves_defaults(),
  1250. selection_box = {
  1251. type = "fixed",
  1252. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, 0.5, 6 / 16},
  1253. },
  1254. })
  1255. minetest.register_node("default:grass_1", {
  1256. description = S("Grass"),
  1257. drawtype = "plantlike",
  1258. waving = 1,
  1259. tiles = {"default_grass_1.png"},
  1260. -- Use texture of a taller grass stage in inventory
  1261. inventory_image = "default_grass_3.png",
  1262. wield_image = "default_grass_3.png",
  1263. paramtype = "light",
  1264. sunlight_propagates = true,
  1265. walkable = false,
  1266. buildable_to = true,
  1267. groups = {snappy = 3, flora = 1, attached_node = 1, grass = 1,
  1268. normal_grass = 1, flammable = 1},
  1269. sounds = default.node_sound_leaves_defaults(),
  1270. selection_box = {
  1271. type = "fixed",
  1272. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -5 / 16, 6 / 16},
  1273. },
  1274. on_place = function(itemstack, placer, pointed_thing)
  1275. -- place a random grass node
  1276. local stack = ItemStack("default:grass_" .. math.random(1,5))
  1277. local ret = minetest.item_place(stack, placer, pointed_thing)
  1278. return ItemStack("default:grass_1 " ..
  1279. itemstack:get_count() - (1 - ret:get_count()))
  1280. end,
  1281. })
  1282. for i = 2, 5 do
  1283. minetest.register_node("default:grass_" .. i, {
  1284. description = S("Grass"),
  1285. drawtype = "plantlike",
  1286. waving = 1,
  1287. tiles = {"default_grass_" .. i .. ".png"},
  1288. inventory_image = "default_grass_" .. i .. ".png",
  1289. wield_image = "default_grass_" .. i .. ".png",
  1290. paramtype = "light",
  1291. sunlight_propagates = true,
  1292. walkable = false,
  1293. buildable_to = true,
  1294. drop = "default:grass_1",
  1295. groups = {snappy = 3, flora = 1, attached_node = 1,
  1296. not_in_creative_inventory = 1, grass = 1,
  1297. normal_grass = 1, flammable = 1},
  1298. sounds = default.node_sound_leaves_defaults(),
  1299. selection_box = {
  1300. type = "fixed",
  1301. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
  1302. },
  1303. })
  1304. end
  1305. minetest.register_node("default:dry_grass_1", {
  1306. description = S("Savanna Grass"),
  1307. drawtype = "plantlike",
  1308. waving = 1,
  1309. tiles = {"default_dry_grass_1.png"},
  1310. inventory_image = "default_dry_grass_3.png",
  1311. wield_image = "default_dry_grass_3.png",
  1312. paramtype = "light",
  1313. sunlight_propagates = true,
  1314. walkable = false,
  1315. buildable_to = true,
  1316. groups = {snappy = 3, flammable = 3, flora = 1,
  1317. attached_node = 1, grass = 1, dry_grass = 1},
  1318. sounds = default.node_sound_leaves_defaults(),
  1319. selection_box = {
  1320. type = "fixed",
  1321. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -3 / 16, 6 / 16},
  1322. },
  1323. on_place = function(itemstack, placer, pointed_thing)
  1324. -- place a random dry grass node
  1325. local stack = ItemStack("default:dry_grass_" .. math.random(1, 5))
  1326. local ret = minetest.item_place(stack, placer, pointed_thing)
  1327. return ItemStack("default:dry_grass_1 " ..
  1328. itemstack:get_count() - (1 - ret:get_count()))
  1329. end,
  1330. })
  1331. for i = 2, 5 do
  1332. minetest.register_node("default:dry_grass_" .. i, {
  1333. description = S("Savanna Grass"),
  1334. drawtype = "plantlike",
  1335. waving = 1,
  1336. tiles = {"default_dry_grass_" .. i .. ".png"},
  1337. inventory_image = "default_dry_grass_" .. i .. ".png",
  1338. wield_image = "default_dry_grass_" .. i .. ".png",
  1339. paramtype = "light",
  1340. sunlight_propagates = true,
  1341. walkable = false,
  1342. buildable_to = true,
  1343. groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
  1344. not_in_creative_inventory = 1, grass = 1, dry_grass = 1},
  1345. drop = "default:dry_grass_1",
  1346. sounds = default.node_sound_leaves_defaults(),
  1347. selection_box = {
  1348. type = "fixed",
  1349. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -1 / 16, 6 / 16},
  1350. },
  1351. })
  1352. end
  1353. minetest.register_node("default:fern_1", {
  1354. description = S("Fern"),
  1355. drawtype = "plantlike",
  1356. waving = 1,
  1357. tiles = {"default_fern_1.png"},
  1358. inventory_image = "default_fern_1.png",
  1359. wield_image = "default_fern_1.png",
  1360. paramtype = "light",
  1361. sunlight_propagates = true,
  1362. walkable = false,
  1363. buildable_to = true,
  1364. groups = {snappy = 3, flammable = 3, flora = 1, grass = 1,
  1365. fern = 1, attached_node = 1},
  1366. sounds = default.node_sound_leaves_defaults(),
  1367. selection_box = {
  1368. type = "fixed",
  1369. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
  1370. },
  1371. on_place = function(itemstack, placer, pointed_thing)
  1372. -- place a random fern node
  1373. local stack = ItemStack("default:fern_" .. math.random(1, 3))
  1374. local ret = minetest.item_place(stack, placer, pointed_thing)
  1375. return ItemStack("default:fern_1 " ..
  1376. itemstack:get_count() - (1 - ret:get_count()))
  1377. end,
  1378. })
  1379. for i = 2, 3 do
  1380. minetest.register_node("default:fern_" .. i, {
  1381. description = S("Fern"),
  1382. drawtype = "plantlike",
  1383. waving = 1,
  1384. visual_scale = 2,
  1385. tiles = {"default_fern_" .. i .. ".png"},
  1386. inventory_image = "default_fern_" .. i .. ".png",
  1387. wield_image = "default_fern_" .. i .. ".png",
  1388. paramtype = "light",
  1389. sunlight_propagates = true,
  1390. walkable = false,
  1391. buildable_to = true,
  1392. groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
  1393. grass = 1, fern = 1, not_in_creative_inventory = 1},
  1394. drop = "default:fern_1",
  1395. sounds = default.node_sound_leaves_defaults(),
  1396. selection_box = {
  1397. type = "fixed",
  1398. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
  1399. },
  1400. })
  1401. end
  1402. minetest.register_node("default:marram_grass_1", {
  1403. description = S("Marram Grass"),
  1404. drawtype = "plantlike",
  1405. waving = 1,
  1406. tiles = {"default_marram_grass_1.png"},
  1407. inventory_image = "default_marram_grass_1.png",
  1408. wield_image = "default_marram_grass_1.png",
  1409. paramtype = "light",
  1410. sunlight_propagates = true,
  1411. walkable = false,
  1412. buildable_to = true,
  1413. groups = {snappy = 3, flammable = 3, flora = 1, grass = 1, marram_grass = 1,
  1414. attached_node = 1},
  1415. sounds = default.node_sound_leaves_defaults(),
  1416. selection_box = {
  1417. type = "fixed",
  1418. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
  1419. },
  1420. on_place = function(itemstack, placer, pointed_thing)
  1421. -- place a random marram grass node
  1422. local stack = ItemStack("default:marram_grass_" .. math.random(1, 3))
  1423. local ret = minetest.item_place(stack, placer, pointed_thing)
  1424. return ItemStack("default:marram_grass_1 " ..
  1425. itemstack:get_count() - (1 - ret:get_count()))
  1426. end,
  1427. })
  1428. for i = 2, 3 do
  1429. minetest.register_node("default:marram_grass_" .. i, {
  1430. description = S("Marram Grass"),
  1431. drawtype = "plantlike",
  1432. waving = 1,
  1433. tiles = {"default_marram_grass_" .. i .. ".png"},
  1434. inventory_image = "default_marram_grass_" .. i .. ".png",
  1435. wield_image = "default_marram_grass_" .. i .. ".png",
  1436. paramtype = "light",
  1437. sunlight_propagates = true,
  1438. walkable = false,
  1439. buildable_to = true,
  1440. groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1,
  1441. grass = 1, marram_grass = 1, not_in_creative_inventory = 1},
  1442. drop = "default:marram_grass_1",
  1443. sounds = default.node_sound_leaves_defaults(),
  1444. selection_box = {
  1445. type = "fixed",
  1446. fixed = {-6 / 16, -0.5, -6 / 16, 6 / 16, -0.25, 6 / 16},
  1447. },
  1448. })
  1449. end
  1450. minetest.register_node("default:bush_stem", {
  1451. description = S("Bush Stem"),
  1452. drawtype = "plantlike",
  1453. visual_scale = 1.41,
  1454. tiles = {"default_bush_stem.png"},
  1455. inventory_image = "default_bush_stem.png",
  1456. wield_image = "default_bush_stem.png",
  1457. paramtype = "light",
  1458. sunlight_propagates = true,
  1459. groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  1460. sounds = default.node_sound_wood_defaults(),
  1461. selection_box = {
  1462. type = "fixed",
  1463. fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
  1464. },
  1465. })
  1466. minetest.register_node("default:bush_leaves", {
  1467. description = S("Bush Leaves"),
  1468. drawtype = "allfaces_optional",
  1469. tiles = {"default_leaves_simple.png"},
  1470. paramtype = "light",
  1471. groups = {snappy = 3, flammable = 2, leaves = 1},
  1472. drop = {
  1473. max_items = 1,
  1474. items = {
  1475. {items = {"default:bush_sapling"}, rarity = 5},
  1476. {items = {"default:bush_leaves"}}
  1477. }
  1478. },
  1479. sounds = default.node_sound_leaves_defaults(),
  1480. after_place_node = after_place_leaves,
  1481. })
  1482. minetest.register_node("default:bush_sapling", {
  1483. description = S("Bush Sapling"),
  1484. drawtype = "plantlike",
  1485. tiles = {"default_bush_sapling.png"},
  1486. inventory_image = "default_bush_sapling.png",
  1487. wield_image = "default_bush_sapling.png",
  1488. paramtype = "light",
  1489. sunlight_propagates = true,
  1490. walkable = false,
  1491. on_timer = grow_sapling,
  1492. selection_box = {
  1493. type = "fixed",
  1494. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
  1495. },
  1496. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  1497. attached_node = 1, sapling = 1},
  1498. sounds = default.node_sound_leaves_defaults(),
  1499. on_construct = function(pos)
  1500. minetest.get_node_timer(pos):start(math.random(300, 1500))
  1501. end,
  1502. on_place = function(itemstack, placer, pointed_thing)
  1503. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  1504. "default:bush_sapling",
  1505. -- minp, maxp to be checked, relative to sapling pos
  1506. {x = -1, y = 0, z = -1},
  1507. {x = 1, y = 1, z = 1},
  1508. -- maximum interval of interior volume check
  1509. 2)
  1510. return itemstack
  1511. end,
  1512. })
  1513. minetest.register_node("default:blueberry_bush_leaves_with_berries", {
  1514. description = S("Blueberry Bush Leaves with Berries"),
  1515. drawtype = "allfaces_optional",
  1516. tiles = {"default_blueberry_bush_leaves.png^default_blueberry_overlay.png"},
  1517. paramtype = "light",
  1518. groups = {snappy = 3, flammable = 2, leaves = 1, dig_immediate = 3},
  1519. drop = "default:blueberries",
  1520. sounds = default.node_sound_leaves_defaults(),
  1521. node_dig_prediction = "default:blueberry_bush_leaves",
  1522. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  1523. minetest.set_node(pos, {name = "default:blueberry_bush_leaves"})
  1524. minetest.get_node_timer(pos):start(math.random(300, 1500))
  1525. end,
  1526. })
  1527. minetest.register_node("default:blueberry_bush_leaves", {
  1528. description = S("Blueberry Bush Leaves"),
  1529. drawtype = "allfaces_optional",
  1530. tiles = {"default_blueberry_bush_leaves.png"},
  1531. paramtype = "light",
  1532. groups = {snappy = 3, flammable = 2, leaves = 1},
  1533. drop = {
  1534. max_items = 1,
  1535. items = {
  1536. {items = {"default:blueberry_bush_sapling"}, rarity = 5},
  1537. {items = {"default:blueberry_bush_leaves"}}
  1538. }
  1539. },
  1540. sounds = default.node_sound_leaves_defaults(),
  1541. on_timer = function(pos, elapsed)
  1542. if minetest.get_node_light(pos) < 11 then
  1543. minetest.get_node_timer(pos):start(200)
  1544. else
  1545. minetest.set_node(pos, {name = "default:blueberry_bush_leaves_with_berries"})
  1546. end
  1547. end,
  1548. after_place_node = after_place_leaves,
  1549. })
  1550. minetest.register_node("default:blueberry_bush_sapling", {
  1551. description = S("Blueberry Bush Sapling"),
  1552. drawtype = "plantlike",
  1553. tiles = {"default_blueberry_bush_sapling.png"},
  1554. inventory_image = "default_blueberry_bush_sapling.png",
  1555. wield_image = "default_blueberry_bush_sapling.png",
  1556. paramtype = "light",
  1557. sunlight_propagates = true,
  1558. walkable = false,
  1559. on_timer = grow_sapling,
  1560. selection_box = {
  1561. type = "fixed",
  1562. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
  1563. },
  1564. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  1565. attached_node = 1, sapling = 1},
  1566. sounds = default.node_sound_leaves_defaults(),
  1567. on_construct = function(pos)
  1568. minetest.get_node_timer(pos):start(math.random(300, 1500))
  1569. end,
  1570. on_place = function(itemstack, placer, pointed_thing)
  1571. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  1572. "default:blueberry_bush_sapling",
  1573. -- minp, maxp to be checked, relative to sapling pos
  1574. {x = -1, y = 0, z = -1},
  1575. {x = 1, y = 1, z = 1},
  1576. -- maximum interval of interior volume check
  1577. 2)
  1578. return itemstack
  1579. end,
  1580. })
  1581. minetest.register_node("default:acacia_bush_stem", {
  1582. description = S("Acacia Bush Stem"),
  1583. drawtype = "plantlike",
  1584. visual_scale = 1.41,
  1585. tiles = {"default_acacia_bush_stem.png"},
  1586. inventory_image = "default_acacia_bush_stem.png",
  1587. wield_image = "default_acacia_bush_stem.png",
  1588. paramtype = "light",
  1589. sunlight_propagates = true,
  1590. groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  1591. sounds = default.node_sound_wood_defaults(),
  1592. selection_box = {
  1593. type = "fixed",
  1594. fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
  1595. },
  1596. })
  1597. minetest.register_node("default:acacia_bush_leaves", {
  1598. description = S("Acacia Bush Leaves"),
  1599. drawtype = "allfaces_optional",
  1600. tiles = {"default_acacia_leaves_simple.png"},
  1601. paramtype = "light",
  1602. groups = {snappy = 3, flammable = 2, leaves = 1},
  1603. drop = {
  1604. max_items = 1,
  1605. items = {
  1606. {items = {"default:acacia_bush_sapling"}, rarity = 5},
  1607. {items = {"default:acacia_bush_leaves"}}
  1608. }
  1609. },
  1610. sounds = default.node_sound_leaves_defaults(),
  1611. after_place_node = after_place_leaves,
  1612. })
  1613. minetest.register_node("default:acacia_bush_sapling", {
  1614. description = S("Acacia Bush Sapling"),
  1615. drawtype = "plantlike",
  1616. tiles = {"default_acacia_bush_sapling.png"},
  1617. inventory_image = "default_acacia_bush_sapling.png",
  1618. wield_image = "default_acacia_bush_sapling.png",
  1619. paramtype = "light",
  1620. sunlight_propagates = true,
  1621. walkable = false,
  1622. on_timer = grow_sapling,
  1623. selection_box = {
  1624. type = "fixed",
  1625. fixed = {-3 / 16, -0.5, -3 / 16, 3 / 16, 2 / 16, 3 / 16}
  1626. },
  1627. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  1628. attached_node = 1, sapling = 1},
  1629. sounds = default.node_sound_leaves_defaults(),
  1630. on_construct = function(pos)
  1631. minetest.get_node_timer(pos):start(math.random(300, 1500))
  1632. end,
  1633. on_place = function(itemstack, placer, pointed_thing)
  1634. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  1635. "default:acacia_bush_sapling",
  1636. -- minp, maxp to be checked, relative to sapling pos
  1637. {x = -1, y = 0, z = -1},
  1638. {x = 1, y = 1, z = 1},
  1639. -- maximum interval of interior volume check
  1640. 2)
  1641. return itemstack
  1642. end,
  1643. })
  1644. minetest.register_node("default:pine_bush_stem", {
  1645. description = S("Pine Bush Stem"),
  1646. drawtype = "plantlike",
  1647. visual_scale = 1.41,
  1648. tiles = {"default_pine_bush_stem.png"},
  1649. inventory_image = "default_pine_bush_stem.png",
  1650. wield_image = "default_pine_bush_stem.png",
  1651. paramtype = "light",
  1652. sunlight_propagates = true,
  1653. groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
  1654. sounds = default.node_sound_wood_defaults(),
  1655. selection_box = {
  1656. type = "fixed",
  1657. fixed = {-7 / 16, -0.5, -7 / 16, 7 / 16, 0.5, 7 / 16},
  1658. },
  1659. })
  1660. minetest.register_node("default:pine_bush_needles", {
  1661. description = S("Pine Bush Needles"),
  1662. drawtype = "allfaces_optional",
  1663. tiles = {"default_pine_needles.png"},
  1664. paramtype = "light",
  1665. groups = {snappy = 3, flammable = 2, leaves = 1},
  1666. drop = {
  1667. max_items = 1,
  1668. items = {
  1669. {items = {"default:pine_bush_sapling"}, rarity = 5},
  1670. {items = {"default:pine_bush_needles"}}
  1671. }
  1672. },
  1673. sounds = default.node_sound_leaves_defaults(),
  1674. after_place_node = after_place_leaves,
  1675. })
  1676. minetest.register_node("default:pine_bush_sapling", {
  1677. description = S("Pine Bush Sapling"),
  1678. drawtype = "plantlike",
  1679. tiles = {"default_pine_bush_sapling.png"},
  1680. inventory_image = "default_pine_bush_sapling.png",
  1681. wield_image = "default_pine_bush_sapling.png",
  1682. paramtype = "light",
  1683. sunlight_propagates = true,
  1684. walkable = false,
  1685. on_timer = grow_sapling,
  1686. selection_box = {
  1687. type = "fixed",
  1688. fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 2 / 16, 4 / 16}
  1689. },
  1690. groups = {snappy = 2, dig_immediate = 3, flammable = 2,
  1691. attached_node = 1, sapling = 1},
  1692. sounds = default.node_sound_leaves_defaults(),
  1693. on_construct = function(pos)
  1694. minetest.get_node_timer(pos):start(math.random(300, 1500))
  1695. end,
  1696. on_place = function(itemstack, placer, pointed_thing)
  1697. itemstack = default.sapling_on_place(itemstack, placer, pointed_thing,
  1698. "default:pine_bush_sapling",
  1699. -- minp, maxp to be checked, relative to sapling pos
  1700. {x = -1, y = 0, z = -1},
  1701. {x = 1, y = 1, z = 1},
  1702. -- maximum interval of interior volume check
  1703. 2)
  1704. return itemstack
  1705. end,
  1706. })
  1707. minetest.register_node("default:sand_with_kelp", {
  1708. description = S("Kelp"),
  1709. drawtype = "plantlike_rooted",
  1710. waving = 1,
  1711. tiles = {"default_sand.png"},
  1712. special_tiles = {{name = "default_kelp.png", tileable_vertical = true}},
  1713. inventory_image = "default_kelp.png",
  1714. wield_image = "default_kelp.png",
  1715. paramtype = "light",
  1716. paramtype2 = "leveled",
  1717. groups = {snappy = 3},
  1718. selection_box = {
  1719. type = "fixed",
  1720. fixed = {
  1721. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  1722. {-2/16, 0.5, -2/16, 2/16, 3.5, 2/16},
  1723. },
  1724. },
  1725. node_dig_prediction = "default:sand",
  1726. node_placement_prediction = "",
  1727. sounds = default.node_sound_sand_defaults({
  1728. dig = {name = "default_dig_snappy", gain = 0.2},
  1729. dug = {name = "default_grass_footstep", gain = 0.25},
  1730. }),
  1731. on_place = function(itemstack, placer, pointed_thing)
  1732. -- Call on_rightclick if the pointed node defines it
  1733. if pointed_thing.type == "node" and placer and
  1734. not placer:get_player_control().sneak then
  1735. local node_ptu = minetest.get_node(pointed_thing.under)
  1736. local def_ptu = minetest.registered_nodes[node_ptu.name]
  1737. if def_ptu and def_ptu.on_rightclick then
  1738. return def_ptu.on_rightclick(pointed_thing.under, node_ptu, placer,
  1739. itemstack, pointed_thing)
  1740. end
  1741. end
  1742. local pos = pointed_thing.under
  1743. if minetest.get_node(pos).name ~= "default:sand" then
  1744. return itemstack
  1745. end
  1746. local height = math.random(4, 6)
  1747. local pos_top = {x = pos.x, y = pos.y + height, z = pos.z}
  1748. local node_top = minetest.get_node(pos_top)
  1749. local def_top = minetest.registered_nodes[node_top.name]
  1750. local player_name = placer:get_player_name()
  1751. if def_top and def_top.liquidtype == "source" and
  1752. minetest.get_item_group(node_top.name, "water") > 0 then
  1753. if not minetest.is_protected(pos, player_name) and
  1754. not minetest.is_protected(pos_top, player_name) then
  1755. minetest.set_node(pos, {name = "default:sand_with_kelp",
  1756. param2 = height * 16})
  1757. if not minetest.is_creative_enabled(player_name) then
  1758. itemstack:take_item()
  1759. end
  1760. else
  1761. minetest.chat_send_player(player_name, "Node is protected")
  1762. minetest.record_protection_violation(pos, player_name)
  1763. end
  1764. end
  1765. return itemstack
  1766. end,
  1767. after_destruct = function(pos, oldnode)
  1768. minetest.set_node(pos, {name = "default:sand"})
  1769. end
  1770. })
  1771. --
  1772. -- Corals
  1773. --
  1774. local function coral_on_place(itemstack, placer, pointed_thing)
  1775. if pointed_thing.type ~= "node" or not placer then
  1776. return itemstack
  1777. end
  1778. local player_name = placer:get_player_name()
  1779. local pos_under = pointed_thing.under
  1780. local pos_above = pointed_thing.above
  1781. local node_under = minetest.get_node(pos_under)
  1782. local def_under = minetest.registered_nodes[node_under.name]
  1783. if def_under and def_under.on_rightclick and not placer:get_player_control().sneak then
  1784. return def_under.on_rightclick(pos_under, node_under,
  1785. placer, itemstack, pointed_thing) or itemstack
  1786. end
  1787. if node_under.name ~= "default:coral_skeleton" or
  1788. minetest.get_node(pos_above).name ~= "default:water_source" then
  1789. return itemstack
  1790. end
  1791. if minetest.is_protected(pos_under, player_name) or
  1792. minetest.is_protected(pos_above, player_name) then
  1793. minetest.log("action", player_name
  1794. .. " tried to place " .. itemstack:get_name()
  1795. .. " at protected position "
  1796. .. minetest.pos_to_string(pos_under))
  1797. minetest.record_protection_violation(pos_under, player_name)
  1798. return itemstack
  1799. end
  1800. node_under.name = itemstack:get_name()
  1801. minetest.set_node(pos_under, node_under)
  1802. if not minetest.is_creative_enabled(player_name) then
  1803. itemstack:take_item()
  1804. end
  1805. return itemstack
  1806. end
  1807. minetest.register_node("default:coral_green", {
  1808. description = S("Green Coral"),
  1809. drawtype = "plantlike_rooted",
  1810. waving = 1,
  1811. paramtype = "light",
  1812. tiles = {"default_coral_skeleton.png"},
  1813. special_tiles = {{name = "default_coral_green.png", tileable_vertical = true}},
  1814. inventory_image = "default_coral_green.png",
  1815. wield_image = "default_coral_green.png",
  1816. groups = {snappy = 3},
  1817. selection_box = {
  1818. type = "fixed",
  1819. fixed = {
  1820. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  1821. {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16},
  1822. },
  1823. },
  1824. node_dig_prediction = "default:coral_skeleton",
  1825. node_placement_prediction = "",
  1826. sounds = default.node_sound_stone_defaults({
  1827. dig = {name = "default_dig_snappy", gain = 0.2},
  1828. dug = {name = "default_grass_footstep", gain = 0.25},
  1829. }),
  1830. on_place = coral_on_place,
  1831. after_destruct = function(pos, oldnode)
  1832. minetest.set_node(pos, {name = "default:coral_skeleton"})
  1833. end,
  1834. })
  1835. minetest.register_node("default:coral_pink", {
  1836. description = S("Pink Coral"),
  1837. drawtype = "plantlike_rooted",
  1838. waving = 1,
  1839. paramtype = "light",
  1840. tiles = {"default_coral_skeleton.png"},
  1841. special_tiles = {{name = "default_coral_pink.png", tileable_vertical = true}},
  1842. inventory_image = "default_coral_pink.png",
  1843. wield_image = "default_coral_pink.png",
  1844. groups = {snappy = 3},
  1845. selection_box = {
  1846. type = "fixed",
  1847. fixed = {
  1848. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  1849. {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16},
  1850. },
  1851. },
  1852. node_dig_prediction = "default:coral_skeleton",
  1853. node_placement_prediction = "",
  1854. sounds = default.node_sound_stone_defaults({
  1855. dig = {name = "default_dig_snappy", gain = 0.2},
  1856. dug = {name = "default_grass_footstep", gain = 0.25},
  1857. }),
  1858. on_place = coral_on_place,
  1859. after_destruct = function(pos, oldnode)
  1860. minetest.set_node(pos, {name = "default:coral_skeleton"})
  1861. end,
  1862. })
  1863. minetest.register_node("default:coral_cyan", {
  1864. description = S("Cyan Coral"),
  1865. drawtype = "plantlike_rooted",
  1866. waving = 1,
  1867. paramtype = "light",
  1868. tiles = {"default_coral_skeleton.png"},
  1869. special_tiles = {{name = "default_coral_cyan.png", tileable_vertical = true}},
  1870. inventory_image = "default_coral_cyan.png",
  1871. wield_image = "default_coral_cyan.png",
  1872. groups = {snappy = 3},
  1873. selection_box = {
  1874. type = "fixed",
  1875. fixed = {
  1876. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  1877. {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16},
  1878. },
  1879. },
  1880. node_dig_prediction = "default:coral_skeleton",
  1881. node_placement_prediction = "",
  1882. sounds = default.node_sound_stone_defaults({
  1883. dig = {name = "default_dig_snappy", gain = 0.2},
  1884. dug = {name = "default_grass_footstep", gain = 0.25},
  1885. }),
  1886. on_place = coral_on_place,
  1887. after_destruct = function(pos, oldnode)
  1888. minetest.set_node(pos, {name = "default:coral_skeleton"})
  1889. end,
  1890. })
  1891. minetest.register_node("default:coral_brown", {
  1892. description = S("Brown Coral"),
  1893. tiles = {"default_coral_brown.png"},
  1894. groups = {cracky = 3},
  1895. drop = "default:coral_skeleton",
  1896. sounds = default.node_sound_stone_defaults(),
  1897. })
  1898. minetest.register_node("default:coral_orange", {
  1899. description = S("Orange Coral"),
  1900. tiles = {"default_coral_orange.png"},
  1901. groups = {cracky = 3},
  1902. drop = "default:coral_skeleton",
  1903. sounds = default.node_sound_stone_defaults(),
  1904. })
  1905. minetest.register_node("default:coral_skeleton", {
  1906. description = S("Coral Skeleton"),
  1907. tiles = {"default_coral_skeleton.png"},
  1908. groups = {cracky = 3},
  1909. sounds = default.node_sound_stone_defaults(),
  1910. })
  1911. --
  1912. -- Liquids
  1913. --
  1914. minetest.register_node("default:water_source", {
  1915. description = S("Water Source"),
  1916. drawtype = "liquid",
  1917. waving = 3,
  1918. tiles = {
  1919. {
  1920. name = "default_water_source_animated.png",
  1921. backface_culling = false,
  1922. animation = {
  1923. type = "vertical_frames",
  1924. aspect_w = 16,
  1925. aspect_h = 16,
  1926. length = 2.0,
  1927. },
  1928. },
  1929. {
  1930. name = "default_water_source_animated.png",
  1931. backface_culling = true,
  1932. animation = {
  1933. type = "vertical_frames",
  1934. aspect_w = 16,
  1935. aspect_h = 16,
  1936. length = 2.0,
  1937. },
  1938. },
  1939. },
  1940. use_texture_alpha = "blend",
  1941. paramtype = "light",
  1942. walkable = false,
  1943. pointable = false,
  1944. diggable = false,
  1945. buildable_to = true,
  1946. is_ground_content = false,
  1947. drop = "",
  1948. drowning = 1,
  1949. liquidtype = "source",
  1950. liquid_alternative_flowing = "default:water_flowing",
  1951. liquid_alternative_source = "default:water_source",
  1952. liquid_viscosity = 1,
  1953. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1954. groups = {water = 3, liquid = 3, cools_lava = 1},
  1955. sounds = default.node_sound_water_defaults(),
  1956. })
  1957. minetest.register_node("default:water_flowing", {
  1958. description = S("Flowing Water"),
  1959. drawtype = "flowingliquid",
  1960. waving = 3,
  1961. tiles = {"default_water.png"},
  1962. special_tiles = {
  1963. {
  1964. name = "default_water_flowing_animated.png",
  1965. backface_culling = false,
  1966. animation = {
  1967. type = "vertical_frames",
  1968. aspect_w = 16,
  1969. aspect_h = 16,
  1970. length = 0.5,
  1971. },
  1972. },
  1973. {
  1974. name = "default_water_flowing_animated.png",
  1975. backface_culling = true,
  1976. animation = {
  1977. type = "vertical_frames",
  1978. aspect_w = 16,
  1979. aspect_h = 16,
  1980. length = 0.5,
  1981. },
  1982. },
  1983. },
  1984. use_texture_alpha = "blend",
  1985. paramtype = "light",
  1986. paramtype2 = "flowingliquid",
  1987. walkable = false,
  1988. pointable = false,
  1989. diggable = false,
  1990. buildable_to = true,
  1991. is_ground_content = false,
  1992. drop = "",
  1993. drowning = 1,
  1994. liquidtype = "flowing",
  1995. liquid_alternative_flowing = "default:water_flowing",
  1996. liquid_alternative_source = "default:water_source",
  1997. liquid_viscosity = 1,
  1998. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1999. groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
  2000. cools_lava = 1},
  2001. sounds = default.node_sound_water_defaults(),
  2002. })
  2003. minetest.register_node("default:river_water_source", {
  2004. description = S("River Water Source"),
  2005. drawtype = "liquid",
  2006. tiles = {
  2007. {
  2008. name = "default_river_water_source_animated.png",
  2009. backface_culling = false,
  2010. animation = {
  2011. type = "vertical_frames",
  2012. aspect_w = 16,
  2013. aspect_h = 16,
  2014. length = 2.0,
  2015. },
  2016. },
  2017. {
  2018. name = "default_river_water_source_animated.png",
  2019. backface_culling = true,
  2020. animation = {
  2021. type = "vertical_frames",
  2022. aspect_w = 16,
  2023. aspect_h = 16,
  2024. length = 2.0,
  2025. },
  2026. },
  2027. },
  2028. use_texture_alpha = "blend",
  2029. paramtype = "light",
  2030. walkable = false,
  2031. pointable = false,
  2032. diggable = false,
  2033. buildable_to = true,
  2034. is_ground_content = false,
  2035. drop = "",
  2036. drowning = 1,
  2037. liquidtype = "source",
  2038. liquid_alternative_flowing = "default:river_water_flowing",
  2039. liquid_alternative_source = "default:river_water_source",
  2040. liquid_viscosity = 1,
  2041. -- Not renewable to avoid horizontal spread of water sources in sloping
  2042. -- rivers that can cause water to overflow riverbanks and cause floods.
  2043. -- River water source is instead made renewable by the 'force renew'
  2044. -- option used in the 'bucket' mod by the river water bucket.
  2045. liquid_renewable = false,
  2046. liquid_range = 2,
  2047. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  2048. groups = {water = 3, liquid = 3, cools_lava = 1},
  2049. sounds = default.node_sound_water_defaults(),
  2050. })
  2051. minetest.register_node("default:river_water_flowing", {
  2052. description = S("Flowing River Water"),
  2053. drawtype = "flowingliquid",
  2054. tiles = {"default_river_water.png"},
  2055. special_tiles = {
  2056. {
  2057. name = "default_river_water_flowing_animated.png",
  2058. backface_culling = false,
  2059. animation = {
  2060. type = "vertical_frames",
  2061. aspect_w = 16,
  2062. aspect_h = 16,
  2063. length = 0.5,
  2064. },
  2065. },
  2066. {
  2067. name = "default_river_water_flowing_animated.png",
  2068. backface_culling = true,
  2069. animation = {
  2070. type = "vertical_frames",
  2071. aspect_w = 16,
  2072. aspect_h = 16,
  2073. length = 0.5,
  2074. },
  2075. },
  2076. },
  2077. use_texture_alpha = "blend",
  2078. paramtype = "light",
  2079. paramtype2 = "flowingliquid",
  2080. walkable = false,
  2081. pointable = false,
  2082. diggable = false,
  2083. buildable_to = true,
  2084. is_ground_content = false,
  2085. drop = "",
  2086. drowning = 1,
  2087. liquidtype = "flowing",
  2088. liquid_alternative_flowing = "default:river_water_flowing",
  2089. liquid_alternative_source = "default:river_water_source",
  2090. liquid_viscosity = 1,
  2091. liquid_renewable = false,
  2092. liquid_range = 2,
  2093. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  2094. groups = {water = 3, liquid = 3, not_in_creative_inventory = 1,
  2095. cools_lava = 1},
  2096. sounds = default.node_sound_water_defaults(),
  2097. })
  2098. minetest.register_node("default:lava_source", {
  2099. description = S("Lava Source"),
  2100. drawtype = "liquid",
  2101. tiles = {
  2102. {
  2103. name = "default_lava_source_animated.png",
  2104. backface_culling = false,
  2105. animation = {
  2106. type = "vertical_frames",
  2107. aspect_w = 16,
  2108. aspect_h = 16,
  2109. length = 3.0,
  2110. },
  2111. },
  2112. {
  2113. name = "default_lava_source_animated.png",
  2114. backface_culling = true,
  2115. animation = {
  2116. type = "vertical_frames",
  2117. aspect_w = 16,
  2118. aspect_h = 16,
  2119. length = 3.0,
  2120. },
  2121. },
  2122. },
  2123. paramtype = "light",
  2124. light_source = default.LIGHT_MAX - 1,
  2125. walkable = false,
  2126. pointable = false,
  2127. diggable = false,
  2128. buildable_to = true,
  2129. is_ground_content = false,
  2130. drop = "",
  2131. drowning = 1,
  2132. liquidtype = "source",
  2133. liquid_alternative_flowing = "default:lava_flowing",
  2134. liquid_alternative_source = "default:lava_source",
  2135. liquid_viscosity = 7,
  2136. liquid_renewable = false,
  2137. damage_per_second = 4 * 2,
  2138. post_effect_color = {a = 191, r = 255, g = 64, b = 0},
  2139. groups = {lava = 3, liquid = 2, igniter = 1},
  2140. })
  2141. minetest.register_node("default:lava_flowing", {
  2142. description = S("Flowing Lava"),
  2143. drawtype = "flowingliquid",
  2144. tiles = {"default_lava.png"},
  2145. special_tiles = {
  2146. {
  2147. name = "default_lava_flowing_animated.png",
  2148. backface_culling = false,
  2149. animation = {
  2150. type = "vertical_frames",
  2151. aspect_w = 16,
  2152. aspect_h = 16,
  2153. length = 3.3,
  2154. },
  2155. },
  2156. {
  2157. name = "default_lava_flowing_animated.png",
  2158. backface_culling = true,
  2159. animation = {
  2160. type = "vertical_frames",
  2161. aspect_w = 16,
  2162. aspect_h = 16,
  2163. length = 3.3,
  2164. },
  2165. },
  2166. },
  2167. paramtype = "light",
  2168. paramtype2 = "flowingliquid",
  2169. light_source = default.LIGHT_MAX - 1,
  2170. walkable = false,
  2171. pointable = false,
  2172. diggable = false,
  2173. buildable_to = true,
  2174. is_ground_content = false,
  2175. drop = "",
  2176. drowning = 1,
  2177. liquidtype = "flowing",
  2178. liquid_alternative_flowing = "default:lava_flowing",
  2179. liquid_alternative_source = "default:lava_source",
  2180. liquid_viscosity = 7,
  2181. liquid_renewable = false,
  2182. damage_per_second = 4 * 2,
  2183. post_effect_color = {a = 191, r = 255, g = 64, b = 0},
  2184. groups = {lava = 3, liquid = 2, igniter = 1,
  2185. not_in_creative_inventory = 1},
  2186. })
  2187. --
  2188. -- Tools / "Advanced" crafting / Non-"natural"
  2189. --
  2190. local bookshelf_formspec =
  2191. "size[8,7;]" ..
  2192. "list[context;books;0,0.3;8,2;]" ..
  2193. "list[current_player;main;0,2.85;8,1;]" ..
  2194. "list[current_player;main;0,4.08;8,3;8]" ..
  2195. "listring[context;books]" ..
  2196. "listring[current_player;main]" ..
  2197. default.get_hotbar_bg(0,2.85)
  2198. local function update_bookshelf(pos)
  2199. local meta = minetest.get_meta(pos)
  2200. local inv = meta:get_inventory()
  2201. local invlist = inv:get_list("books")
  2202. local formspec = bookshelf_formspec
  2203. -- Inventory slots overlay
  2204. local bx, by = 0, 0.3
  2205. local n_written, n_empty = 0, 0
  2206. for i = 1, 16 do
  2207. if i == 9 then
  2208. bx = 0
  2209. by = by + 1
  2210. end
  2211. local stack = invlist[i]
  2212. if stack:is_empty() then
  2213. formspec = formspec ..
  2214. "image[" .. bx .. "," .. by .. ";1,1;default_bookshelf_slot.png]"
  2215. else
  2216. local metatable = stack:get_meta():to_table() or {}
  2217. if metatable.fields and metatable.fields.text then
  2218. n_written = n_written + stack:get_count()
  2219. else
  2220. n_empty = n_empty + stack:get_count()
  2221. end
  2222. end
  2223. bx = bx + 1
  2224. end
  2225. meta:set_string("formspec", formspec)
  2226. if n_written + n_empty == 0 then
  2227. meta:set_string("infotext", S("Empty Bookshelf"))
  2228. else
  2229. meta:set_string("infotext", S("Bookshelf (@1 written, @2 empty books)", n_written, n_empty))
  2230. end
  2231. end
  2232. minetest.register_node("default:bookshelf", {
  2233. description = S("Bookshelf"),
  2234. tiles = {"default_wood.png", "default_wood.png", "default_wood.png",
  2235. "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"},
  2236. paramtype2 = "facedir",
  2237. is_ground_content = false,
  2238. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  2239. sounds = default.node_sound_wood_defaults(),
  2240. on_construct = function(pos)
  2241. local meta = minetest.get_meta(pos)
  2242. local inv = meta:get_inventory()
  2243. inv:set_size("books", 8 * 2)
  2244. update_bookshelf(pos)
  2245. end,
  2246. can_dig = function(pos,player)
  2247. local inv = minetest.get_meta(pos):get_inventory()
  2248. return inv:is_empty("books")
  2249. end,
  2250. allow_metadata_inventory_put = function(pos, listname, index, stack)
  2251. if minetest.get_item_group(stack:get_name(), "book") ~= 0 then
  2252. return stack:get_count()
  2253. end
  2254. return 0
  2255. end,
  2256. on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
  2257. minetest.log("action", player:get_player_name() ..
  2258. " moves stuff in bookshelf at " .. minetest.pos_to_string(pos))
  2259. update_bookshelf(pos)
  2260. end,
  2261. on_metadata_inventory_put = function(pos, listname, index, stack, player)
  2262. minetest.log("action", player:get_player_name() ..
  2263. " puts stuff to bookshelf at " .. minetest.pos_to_string(pos))
  2264. update_bookshelf(pos)
  2265. end,
  2266. on_metadata_inventory_take = function(pos, listname, index, stack, player)
  2267. minetest.log("action", player:get_player_name() ..
  2268. " takes stuff from bookshelf at " .. minetest.pos_to_string(pos))
  2269. update_bookshelf(pos)
  2270. end,
  2271. on_blast = function(pos)
  2272. local drops = {}
  2273. default.get_inventory_drops(pos, "books", drops)
  2274. drops[#drops+1] = "default:bookshelf"
  2275. minetest.remove_node(pos)
  2276. return drops
  2277. end,
  2278. })
  2279. local function register_sign(material, desc, def)
  2280. minetest.register_node("default:sign_wall_" .. material, {
  2281. description = desc,
  2282. drawtype = "nodebox",
  2283. tiles = {"default_sign_wall_" .. material .. ".png"},
  2284. inventory_image = "default_sign_" .. material .. ".png",
  2285. wield_image = "default_sign_" .. material .. ".png",
  2286. paramtype = "light",
  2287. paramtype2 = "wallmounted",
  2288. sunlight_propagates = true,
  2289. is_ground_content = false,
  2290. walkable = false,
  2291. use_texture_alpha = "opaque",
  2292. node_box = {
  2293. type = "wallmounted",
  2294. wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125},
  2295. wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
  2296. wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375},
  2297. },
  2298. groups = def.groups,
  2299. legacy_wallmounted = true,
  2300. sounds = def.sounds,
  2301. on_construct = function(pos)
  2302. local meta = minetest.get_meta(pos)
  2303. meta:set_string("formspec", "field[text;;${text}]")
  2304. end,
  2305. on_receive_fields = function(pos, formname, fields, sender)
  2306. local player_name = sender:get_player_name()
  2307. if minetest.is_protected(pos, player_name) then
  2308. minetest.record_protection_violation(pos, player_name)
  2309. return
  2310. end
  2311. local text = fields.text
  2312. if not text then
  2313. return
  2314. end
  2315. if string.len(text) > 512 then
  2316. minetest.chat_send_player(player_name, S("Text too long"))
  2317. return
  2318. end
  2319. minetest.log("action", player_name .. " wrote \"" .. text ..
  2320. "\" to the sign at " .. minetest.pos_to_string(pos))
  2321. local meta = minetest.get_meta(pos)
  2322. meta:set_string("text", text)
  2323. if #text > 0 then
  2324. meta:set_string("infotext", S('"@1"', text))
  2325. else
  2326. meta:set_string("infotext", '')
  2327. end
  2328. end,
  2329. })
  2330. end
  2331. register_sign("wood", S("Wooden Sign"), {
  2332. sounds = default.node_sound_wood_defaults(),
  2333. groups = {choppy = 2, attached_node = 1, flammable = 2, oddly_breakable_by_hand = 3}
  2334. })
  2335. register_sign("steel", S("Steel Sign"), {
  2336. sounds = default.node_sound_metal_defaults(),
  2337. groups = {cracky = 2, attached_node = 1}
  2338. })
  2339. minetest.register_node("default:ladder_wood", {
  2340. description = S("Wooden Ladder"),
  2341. drawtype = "signlike",
  2342. tiles = {"default_ladder_wood.png"},
  2343. inventory_image = "default_ladder_wood.png",
  2344. wield_image = "default_ladder_wood.png",
  2345. paramtype = "light",
  2346. paramtype2 = "wallmounted",
  2347. sunlight_propagates = true,
  2348. walkable = false,
  2349. climbable = true,
  2350. is_ground_content = false,
  2351. selection_box = {
  2352. type = "wallmounted",
  2353. --wall_top = = <default>
  2354. --wall_bottom = = <default>
  2355. --wall_side = = <default>
  2356. },
  2357. groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2},
  2358. legacy_wallmounted = true,
  2359. sounds = default.node_sound_wood_defaults(),
  2360. })
  2361. minetest.register_node("default:ladder_steel", {
  2362. description = S("Steel Ladder"),
  2363. drawtype = "signlike",
  2364. tiles = {"default_ladder_steel.png"},
  2365. inventory_image = "default_ladder_steel.png",
  2366. wield_image = "default_ladder_steel.png",
  2367. paramtype = "light",
  2368. paramtype2 = "wallmounted",
  2369. sunlight_propagates = true,
  2370. walkable = false,
  2371. climbable = true,
  2372. is_ground_content = false,
  2373. selection_box = {
  2374. type = "wallmounted",
  2375. --wall_top = = <default>
  2376. --wall_bottom = = <default>
  2377. --wall_side = = <default>
  2378. },
  2379. groups = {cracky = 2},
  2380. sounds = default.node_sound_metal_defaults(),
  2381. })
  2382. default.register_fence("default:fence_wood", {
  2383. description = S("Apple Wood Fence"),
  2384. texture = "default_fence_wood.png",
  2385. inventory_image = "default_fence_overlay.png^default_wood.png^" ..
  2386. "default_fence_overlay.png^[makealpha:255,126,126",
  2387. wield_image = "default_fence_overlay.png^default_wood.png^" ..
  2388. "default_fence_overlay.png^[makealpha:255,126,126",
  2389. material = "default:wood",
  2390. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  2391. sounds = default.node_sound_wood_defaults()
  2392. })
  2393. default.register_fence("default:fence_acacia_wood", {
  2394. description = S("Acacia Wood Fence"),
  2395. texture = "default_fence_acacia_wood.png",
  2396. inventory_image = "default_fence_overlay.png^default_acacia_wood.png^" ..
  2397. "default_fence_overlay.png^[makealpha:255,126,126",
  2398. wield_image = "default_fence_overlay.png^default_acacia_wood.png^" ..
  2399. "default_fence_overlay.png^[makealpha:255,126,126",
  2400. material = "default:acacia_wood",
  2401. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  2402. sounds = default.node_sound_wood_defaults()
  2403. })
  2404. default.register_fence("default:fence_junglewood", {
  2405. description = S("Jungle Wood Fence"),
  2406. texture = "default_fence_junglewood.png",
  2407. inventory_image = "default_fence_overlay.png^default_junglewood.png^" ..
  2408. "default_fence_overlay.png^[makealpha:255,126,126",
  2409. wield_image = "default_fence_overlay.png^default_junglewood.png^" ..
  2410. "default_fence_overlay.png^[makealpha:255,126,126",
  2411. material = "default:junglewood",
  2412. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  2413. sounds = default.node_sound_wood_defaults()
  2414. })
  2415. default.register_fence("default:fence_pine_wood", {
  2416. description = S("Pine Wood Fence"),
  2417. texture = "default_fence_pine_wood.png",
  2418. inventory_image = "default_fence_overlay.png^default_pine_wood.png^" ..
  2419. "default_fence_overlay.png^[makealpha:255,126,126",
  2420. wield_image = "default_fence_overlay.png^default_pine_wood.png^" ..
  2421. "default_fence_overlay.png^[makealpha:255,126,126",
  2422. material = "default:pine_wood",
  2423. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  2424. sounds = default.node_sound_wood_defaults()
  2425. })
  2426. default.register_fence("default:fence_aspen_wood", {
  2427. description = S("Aspen Wood Fence"),
  2428. texture = "default_fence_aspen_wood.png",
  2429. inventory_image = "default_fence_overlay.png^default_aspen_wood.png^" ..
  2430. "default_fence_overlay.png^[makealpha:255,126,126",
  2431. wield_image = "default_fence_overlay.png^default_aspen_wood.png^" ..
  2432. "default_fence_overlay.png^[makealpha:255,126,126",
  2433. material = "default:aspen_wood",
  2434. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  2435. sounds = default.node_sound_wood_defaults()
  2436. })
  2437. default.register_fence_rail("default:fence_rail_wood", {
  2438. description = S("Apple Wood Fence Rail"),
  2439. texture = "default_fence_rail_wood.png",
  2440. inventory_image = "default_fence_rail_overlay.png^default_wood.png^" ..
  2441. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2442. wield_image = "default_fence_rail_overlay.png^default_wood.png^" ..
  2443. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2444. material = "default:wood",
  2445. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  2446. sounds = default.node_sound_wood_defaults()
  2447. })
  2448. default.register_fence_rail("default:fence_rail_acacia_wood", {
  2449. description = S("Acacia Wood Fence Rail"),
  2450. texture = "default_fence_rail_acacia_wood.png",
  2451. inventory_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" ..
  2452. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2453. wield_image = "default_fence_rail_overlay.png^default_acacia_wood.png^" ..
  2454. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2455. material = "default:acacia_wood",
  2456. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  2457. sounds = default.node_sound_wood_defaults()
  2458. })
  2459. default.register_fence_rail("default:fence_rail_junglewood", {
  2460. description = S("Jungle Wood Fence Rail"),
  2461. texture = "default_fence_rail_junglewood.png",
  2462. inventory_image = "default_fence_rail_overlay.png^default_junglewood.png^" ..
  2463. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2464. wield_image = "default_fence_rail_overlay.png^default_junglewood.png^" ..
  2465. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2466. material = "default:junglewood",
  2467. groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
  2468. sounds = default.node_sound_wood_defaults()
  2469. })
  2470. default.register_fence_rail("default:fence_rail_pine_wood", {
  2471. description = S("Pine Wood Fence Rail"),
  2472. texture = "default_fence_rail_pine_wood.png",
  2473. inventory_image = "default_fence_rail_overlay.png^default_pine_wood.png^" ..
  2474. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2475. wield_image = "default_fence_rail_overlay.png^default_pine_wood.png^" ..
  2476. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2477. material = "default:pine_wood",
  2478. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3},
  2479. sounds = default.node_sound_wood_defaults()
  2480. })
  2481. default.register_fence_rail("default:fence_rail_aspen_wood", {
  2482. description = S("Aspen Wood Fence Rail"),
  2483. texture = "default_fence_rail_aspen_wood.png",
  2484. inventory_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" ..
  2485. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2486. wield_image = "default_fence_rail_overlay.png^default_aspen_wood.png^" ..
  2487. "default_fence_rail_overlay.png^[makealpha:255,126,126",
  2488. material = "default:aspen_wood",
  2489. groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 2},
  2490. sounds = default.node_sound_wood_defaults()
  2491. })
  2492. minetest.register_node("default:glass", {
  2493. description = S("Glass"),
  2494. drawtype = "glasslike_framed_optional",
  2495. tiles = {"default_glass.png", "default_glass_detail.png"},
  2496. use_texture_alpha = "clip", -- only needed for stairs API
  2497. paramtype = "light",
  2498. paramtype2 = "glasslikeliquidlevel",
  2499. sunlight_propagates = true,
  2500. is_ground_content = false,
  2501. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  2502. sounds = default.node_sound_glass_defaults(),
  2503. })
  2504. minetest.register_node("default:obsidian_glass", {
  2505. description = S("Obsidian Glass"),
  2506. drawtype = "glasslike_framed_optional",
  2507. tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
  2508. use_texture_alpha = "clip", -- only needed for stairs API
  2509. paramtype = "light",
  2510. paramtype2 = "glasslikeliquidlevel",
  2511. is_ground_content = false,
  2512. sunlight_propagates = true,
  2513. sounds = default.node_sound_glass_defaults(),
  2514. groups = {cracky = 3},
  2515. })
  2516. minetest.register_node("default:brick", {
  2517. description = S("Brick Block"),
  2518. paramtype2 = "facedir",
  2519. place_param2 = 0,
  2520. tiles = {
  2521. "default_brick.png^[transformFX",
  2522. "default_brick.png",
  2523. },
  2524. is_ground_content = false,
  2525. groups = {cracky = 3},
  2526. sounds = default.node_sound_stone_defaults(),
  2527. })
  2528. minetest.register_node("default:meselamp", {
  2529. description = S("Mese Lamp"),
  2530. drawtype = "glasslike",
  2531. tiles = {"default_meselamp.png"},
  2532. paramtype = "light",
  2533. sunlight_propagates = true,
  2534. is_ground_content = false,
  2535. groups = {cracky = 3, oddly_breakable_by_hand = 3},
  2536. sounds = default.node_sound_glass_defaults(),
  2537. light_source = default.LIGHT_MAX,
  2538. })
  2539. default.register_mesepost("default:mese_post_light", {
  2540. description = S("Apple Wood Mese Post Light"),
  2541. texture = "default_fence_wood.png",
  2542. material = "default:wood",
  2543. })
  2544. default.register_mesepost("default:mese_post_light_acacia_wood", {
  2545. description = S("Acacia Wood Mese Post Light"),
  2546. texture = "default_fence_acacia_wood.png",
  2547. material = "default:acacia_wood",
  2548. })
  2549. default.register_mesepost("default:mese_post_light_junglewood", {
  2550. description = S("Jungle Wood Mese Post Light"),
  2551. texture = "default_fence_junglewood.png",
  2552. material = "default:junglewood",
  2553. })
  2554. default.register_mesepost("default:mese_post_light_pine_wood", {
  2555. description = S("Pine Wood Mese Post Light"),
  2556. texture = "default_fence_pine_wood.png",
  2557. material = "default:pine_wood",
  2558. })
  2559. default.register_mesepost("default:mese_post_light_aspen_wood", {
  2560. description = S("Aspen Wood Mese Post Light"),
  2561. texture = "default_fence_aspen_wood.png",
  2562. material = "default:aspen_wood",
  2563. })
  2564. --
  2565. -- Misc
  2566. --
  2567. minetest.register_node("default:cloud", {
  2568. description = S("Cloud"),
  2569. tiles = {"default_cloud.png"},
  2570. is_ground_content = false,
  2571. sounds = default.node_sound_defaults(),
  2572. groups = {not_in_creative_inventory = 1},
  2573. })
  2574. --
  2575. -- register trees for leafdecay
  2576. --
  2577. if minetest.get_mapgen_setting("mg_name") == "v6" then
  2578. default.register_leafdecay({
  2579. trunks = {"default:tree"},
  2580. leaves = {"default:apple", "default:leaves"},
  2581. radius = 2,
  2582. })
  2583. default.register_leafdecay({
  2584. trunks = {"default:jungletree"},
  2585. leaves = {"default:jungleleaves"},
  2586. radius = 3,
  2587. })
  2588. else
  2589. default.register_leafdecay({
  2590. trunks = {"default:tree"},
  2591. leaves = {"default:apple", "default:leaves"},
  2592. radius = 3,
  2593. })
  2594. default.register_leafdecay({
  2595. trunks = {"default:jungletree"},
  2596. leaves = {"default:jungleleaves"},
  2597. radius = 2,
  2598. })
  2599. end
  2600. default.register_leafdecay({
  2601. trunks = {"default:pine_tree"},
  2602. leaves = {"default:pine_needles"},
  2603. radius = 3,
  2604. })
  2605. default.register_leafdecay({
  2606. trunks = {"default:acacia_tree"},
  2607. leaves = {"default:acacia_leaves"},
  2608. radius = 2,
  2609. })
  2610. default.register_leafdecay({
  2611. trunks = {"default:aspen_tree"},
  2612. leaves = {"default:aspen_leaves"},
  2613. radius = 3,
  2614. })
  2615. default.register_leafdecay({
  2616. trunks = {"default:bush_stem"},
  2617. leaves = {"default:bush_leaves"},
  2618. radius = 1,
  2619. })
  2620. default.register_leafdecay({
  2621. trunks = {"default:acacia_bush_stem"},
  2622. leaves = {"default:acacia_bush_leaves"},
  2623. radius = 1,
  2624. })
  2625. default.register_leafdecay({
  2626. trunks = {"default:pine_bush_stem"},
  2627. leaves = {"default:pine_bush_needles"},
  2628. radius = 1,
  2629. })