nodes.lua 82 KB

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