nodes.lua 75 KB

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