nodes.lua 69 KB

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