nodes.lua 83 KB

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