nodes.lua 81 KB

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