nodes.lua 82 KB

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