nodes.lua 81 KB

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