nodes.lua 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400
  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:obsidian
  24. default:obsidianbrick
  25. default:obsidian_block
  26. Soft / Non-Stone
  27. ----------------
  28. (1. Material 2. Modified forms)
  29. default:dirt
  30. default:dirt_with_grass
  31. default:dirt_with_grass_footsteps
  32. default:dirt_with_dry_grass
  33. default:dirt_with_snow
  34. default:sand
  35. default:desert_sand
  36. default:gravel
  37. default:clay
  38. default:snow
  39. default:snowblock
  40. default:ice
  41. Trees
  42. -----
  43. (1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling 5. Fruits)
  44. default:tree
  45. default:wood
  46. default:leaves
  47. default:sapling
  48. default:apple
  49. default:jungletree
  50. default:junglewood
  51. default:jungleleaves
  52. default:junglesapling
  53. default:pine_tree
  54. default:pine_wood
  55. default:pine_needles
  56. default:pine_sapling
  57. default:acacia_tree
  58. default:acacia_wood
  59. default:acacia_leaves
  60. default:acacia_sapling
  61. default:aspen_tree
  62. default:aspen_wood
  63. default:aspen_leaves
  64. default:aspen_sapling
  65. Ores
  66. ----
  67. (1. In stone 2. Blocks)
  68. default:stone_with_coal
  69. default:coalblock
  70. default:stone_with_iron
  71. default:steelblock
  72. default:stone_with_copper
  73. default:copperblock
  74. default:bronzeblock
  75. default:stone_with_gold
  76. default:goldblock
  77. default:stone_with_mese
  78. default:mese
  79. default:stone_with_diamond
  80. default:diamondblock
  81. Plantlife (non-cubic)
  82. ---------------------
  83. default:cactus
  84. default:papyrus
  85. default:dry_shrub
  86. default:junglegrass
  87. default:grass_1
  88. default:grass_2
  89. default:grass_3
  90. default:grass_4
  91. default:grass_5
  92. default:dry_grass_1
  93. default:dry_grass_2
  94. default:dry_grass_3
  95. default:dry_grass_4
  96. default:dry_grass_5
  97. Liquids
  98. -------
  99. (1. Source 2. Flowing)
  100. default:water_source
  101. default:water_flowing
  102. default:river_water_source
  103. default:river_water_flowing
  104. default:lava_source
  105. default:lava_flowing
  106. Tools / "Advanced" crafting / Non-"natural"
  107. -------------------------------------------
  108. default:sign_wall_wood
  109. default:sign_wall_steel
  110. default:ladder_wood
  111. default:ladder_steel
  112. default:fence_wood
  113. default:fence_acacia_wood
  114. default:fence_junglewood
  115. default:fence_pine_wood
  116. default:fence_aspen_wood
  117. default:glass
  118. default:obsidian_glass
  119. default:rail
  120. default:brick
  121. default:meselamp
  122. Misc
  123. ----
  124. default:cloud
  125. --]]
  126. --
  127. -- Stone
  128. --
  129. -- Localize for performance.
  130. local math_random = math.random
  131. local vector_add = vector.add
  132. minetest.register_node("default:stone", {
  133. description = "Stone",
  134. --[[
  135. drawtype = "airlike",
  136. paramtype = "light",
  137. sunlight_propagates = true,
  138. light_source = 15,
  139. pointable = false,
  140. --]]
  141. tiles = {{name="stone_macro.png", align_style="world", scale=8}},
  142. groups = utility.dig_groups("stone", {
  143. stone = 1, native_stone = 1,
  144. melts = 1, cobble_type = 1,
  145. }),
  146. drop = 'default:cobble',
  147. legacy_mineral = true,
  148. sounds = default.node_sound_stone_defaults(),
  149. _melts_to = "cavestuff:cobble_with_rockmelt",
  150. -- Common stone does not count toward tool's dig count.
  151. _toolranks = {
  152. ignore = true,
  153. },
  154. -- Collapsed stone breaks up into cobble.
  155. on_finish_collapse = function(pos, node)
  156. minetest.swap_node(pos, {name="default:cobble"})
  157. end,
  158. on_collapse_to_entity = function(pos, node)
  159. minetest.add_item(pos, {name="default:cobble"})
  160. end,
  161. })
  162. -- Name is very similar to default:stone to make it hard to detect even with F5 debug info.
  163. minetest.register_node(":defauIt:stone", {
  164. description = "Stone (Please Report To Admin)",
  165. tiles = {"default_stone.png"},
  166. groups = utility.dig_groups("softcobble", {
  167. melts = 1, falling_node = 1,
  168. }),
  169. drop = 'default:cobble',
  170. legacy_mineral = true,
  171. sounds = default.node_sound_stone_defaults(),
  172. _melts_to = "cavestuff:cobble_with_rockmelt",
  173. -- Collapsed stone breaks up into cobble.
  174. on_finish_collapse = function(pos, node)
  175. minetest.swap_node(pos, {name="default:cobble"})
  176. end,
  177. on_collapse_to_entity = function(pos, node)
  178. minetest.add_item(pos, {name="default:cobble"})
  179. end,
  180. -- Player walking on it causes collapse.
  181. on_player_walk_over = function(pos, player)
  182. minetest.check_for_falling(pos)
  183. end,
  184. })
  185. minetest.register_node("default:cobble", {
  186. description = "Cobblestone",
  187. tiles = {"default_cobble.png"},
  188. is_ground_content = false,
  189. groups = utility.dig_groups("cobble", {
  190. stone = 1, native_stone = 1,
  191. melts = 1, cobble_type = 1,
  192. }),
  193. sounds = default.node_sound_stone_defaults(),
  194. _melts_to = "cavestuff:cobble_with_rockmelt",
  195. -- Common stone does not count toward tool's dig count.
  196. _toolranks = {
  197. ignore = true,
  198. },
  199. _no_auto_pop = true,
  200. })
  201. minetest.register_node("default:stonebrick", {
  202. description = "Stone Brick",
  203. paramtype2 = "facedir",
  204. place_param2 = 0,
  205. tiles = {"default_stone_brick.png"},
  206. is_ground_content = false,
  207. groups = utility.dig_groups("brick", {brick = 1}),
  208. sounds = default.node_sound_stone_defaults(),
  209. })
  210. minetest.register_node("default:stone_block", {
  211. description = "Stone Block",
  212. tiles = {"default_stone_block.png"},
  213. is_ground_content = false,
  214. groups = utility.dig_groups("block", {stone=1, block = 1}),
  215. sounds = default.node_sound_stone_defaults(),
  216. })
  217. minetest.register_node("default:mossycobble", {
  218. description = "Mossy Cobblestone",
  219. tiles = {"default_mossycobble.png"},
  220. is_ground_content = false,
  221. groups = utility.dig_groups("cobble", {
  222. stone = 1, native_stone = 1,
  223. melts = 1,
  224. }),
  225. _melts_to = "cavestuff:cobble_with_rockmelt",
  226. sounds = default.node_sound_stone_defaults(),
  227. })
  228. minetest.register_node("default:desert_stone", {
  229. description = "Redstone",
  230. tiles = {{name="desert_stone_macro.png", align_style="world", scale=8}},
  231. groups = utility.dig_groups("stone", {stone = 1, native_stone = 1}),
  232. drop = 'default:desert_cobble2',
  233. legacy_mineral = true,
  234. sounds = default.node_sound_stone_defaults(),
  235. -- Common stone does not count toward tool's dig count.
  236. _toolranks = {
  237. ignore = true,
  238. },
  239. -- Made desert stone a road material on March 16, 2018.
  240. movement_speed_multiplier = default.ROAD_SPEED,
  241. -- Collapsed stone breaks up into cobble.
  242. on_finish_collapse = function(pos, node)
  243. minetest.swap_node(pos, {name="default:desert_cobble2"})
  244. end,
  245. on_collapse_to_entity = function(pos, node)
  246. minetest.add_item(pos, {name="default:desert_cobble2"})
  247. end,
  248. })
  249. minetest.register_node("default:desert_cobble", {
  250. description = "Chalked Redstone Cobble",
  251. tiles = {"default_desert_cobble.png"}, -- Original "chalked" image (pre 5.0.0).
  252. is_ground_content = false,
  253. groups = utility.dig_groups("cobble", {stone = 1, native_stone = 1}),
  254. sounds = default.node_sound_stone_defaults(),
  255. })
  256. minetest.register_node("default:desert_cobble2", {
  257. description = "Redstone Cobble",
  258. tiles = {"default_desert_cobble2.png"},
  259. is_ground_content = false,
  260. groups = utility.dig_groups("cobble"),
  261. sounds = default.node_sound_stone_defaults(),
  262. -- Common stone does not count toward tool's dig count.
  263. _toolranks = {
  264. ignore = true,
  265. },
  266. })
  267. minetest.register_node("default:desert_stonebrick", {
  268. description = "Redstone Brick",
  269. paramtype2 = "facedir",
  270. place_param2 = 0,
  271. tiles = {"default_desert_stone_brick.png"},
  272. is_ground_content = false,
  273. groups = utility.dig_groups("brick", {stone = 1, brick=1}),
  274. sounds = default.node_sound_stone_defaults(),
  275. })
  276. minetest.register_node("default:desert_stone_block", {
  277. description = "Redstone Block",
  278. tiles = {"default_desert_stone_block.png"},
  279. is_ground_content = false,
  280. groups = utility.dig_groups("block", {stone = 1, block=1}),
  281. sounds = default.node_sound_stone_defaults(),
  282. })
  283. minetest.register_node("default:sandstone", {
  284. description = "Sandstone",
  285. tiles = {"default_sandstone.png"},
  286. groups = utility.dig_groups("softstone", {stone=1}),
  287. sounds = default.node_sound_stone_defaults(),
  288. -- Added on March 16, 2018.
  289. movement_speed_multiplier = default.ROAD_SPEED,
  290. })
  291. minetest.register_node("default:sandstonebrick", {
  292. description = "Sandstone Brick",
  293. paramtype2 = "facedir",
  294. place_param2 = 0,
  295. tiles = {"default_sandstone_brick.png"},
  296. is_ground_content = false,
  297. groups = utility.dig_groups("brick", {brick=1}),
  298. sounds = default.node_sound_stone_defaults(),
  299. })
  300. minetest.register_node("default:sandstone_block", {
  301. description = "Sandstone Block",
  302. tiles = {"default_sandstone_block.png"},
  303. is_ground_content = false,
  304. groups = utility.dig_groups("block", {block=1}),
  305. sounds = default.node_sound_stone_defaults(),
  306. })
  307. minetest.register_node("default:desert_sandstone", {
  308. description = "Desert Sandstone",
  309. tiles = {"default_desert_sandstone.png"},
  310. groups = utility.dig_groups("softstone", {stone=1}),
  311. sounds = default.node_sound_stone_defaults(),
  312. movement_speed_multiplier = default.ROAD_SPEED,
  313. })
  314. minetest.register_node("default:desert_sandstone_brick", {
  315. description = "Desert Sandstone Brick",
  316. paramtype2 = "facedir",
  317. place_param2 = 0,
  318. tiles = {"default_desert_sandstone_brick.png"},
  319. is_ground_content = false,
  320. groups = utility.dig_groups("brick", {brick=1}),
  321. sounds = default.node_sound_stone_defaults(),
  322. })
  323. minetest.register_node("default:desert_sandstone_block", {
  324. description = "Desert Sandstone Block",
  325. tiles = {"default_desert_sandstone_block.png"},
  326. is_ground_content = false,
  327. groups = utility.dig_groups("block", {block=1}),
  328. sounds = default.node_sound_stone_defaults(),
  329. })
  330. minetest.register_node("default:silver_sandstone", {
  331. description = "Silver Sandstone",
  332. tiles = {"default_silver_sandstone.png"},
  333. groups = utility.dig_groups("softstone", {stone=1}),
  334. sounds = default.node_sound_stone_defaults(),
  335. movement_speed_multiplier = default.ROAD_SPEED,
  336. })
  337. minetest.register_node("default:silver_sandstone_brick", {
  338. description = "Silver Sandstone Brick",
  339. paramtype2 = "facedir",
  340. place_param2 = 0,
  341. tiles = {"default_silver_sandstone_brick.png"},
  342. is_ground_content = false,
  343. groups = utility.dig_groups("brick", {brick=1}),
  344. sounds = default.node_sound_stone_defaults(),
  345. })
  346. minetest.register_node("default:silver_sandstone_block", {
  347. description = "Silver Sandstone Block",
  348. tiles = {"default_silver_sandstone_block.png"},
  349. is_ground_content = false,
  350. groups = utility.dig_groups("block", {block=1}),
  351. sounds = default.node_sound_stone_defaults(),
  352. })
  353. minetest.register_node("default:obsidian", {
  354. description = "Obsidian",
  355. tiles = {"default_obsidian.png"},
  356. sounds = default.node_sound_stone_defaults(),
  357. groups = utility.dig_groups("obsidian", {stone=1}),
  358. on_blast = function(...) end, -- Blast resistant.
  359. movement_speed_multiplier = default.ROAD_SPEED_CAVERN,
  360. -- Callbacks are overridden in flameportal mod!
  361. })
  362. minetest.register_node("default:obsidianbrick", {
  363. description = "Obsidian Brick",
  364. paramtype2 = "facedir",
  365. place_param2 = 0,
  366. tiles = {"default_obsidian_brick.png"},
  367. is_ground_content = false,
  368. sounds = default.node_sound_stone_defaults(),
  369. groups = utility.dig_groups("brick", {stone=1, brick=1}),
  370. on_blast = function(...) end, -- Blast resistant.
  371. })
  372. minetest.register_node("default:obsidian_block", {
  373. description = "Obsidian Block",
  374. tiles = {"default_obsidian_block.png"},
  375. is_ground_content = false,
  376. sounds = default.node_sound_stone_defaults(),
  377. groups = utility.dig_groups("block", {stone=1, block=1}),
  378. on_blast = function(...) end, -- Blast resistant.
  379. })
  380. --
  381. -- Soft / Non-Stone
  382. --
  383. minetest.register_node("default:dirt", {
  384. description = "Dirt",
  385. tiles = {"default_dirt.png"},
  386. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_sterile_dirt_type = 1, raw_dirt_type = 1, soil = 1}),
  387. post_effect_color = {a=255, r=0, g=0, b=0},
  388. sounds = default.node_sound_dirt_defaults(),
  389. movement_speed_multiplier = default.SLOW_SPEED,
  390. })
  391. minetest.register_node("default:dirt_with_grass", {
  392. description = "Dirt With Grass",
  393. tiles = {
  394. "default_grass.png",
  395. "default_dirt.png",
  396. {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false},
  397. },
  398. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, soil = 1}),
  399. drop = 'default:dirt',
  400. post_effect_color = {a=255, r=0, g=0, b=0},
  401. sounds = default.node_sound_dirt_defaults({
  402. footstep = {name = "default_grass_footstep", gain = 0.25},
  403. }),
  404. -- Depreciated.
  405. --on_timer = function(...)
  406. -- return dirtspread.dirt_on_timer(...)
  407. --end,
  408. on_finish_collapse = function(pos, node)
  409. minetest.swap_node(pos, {name="default:dirt"})
  410. end,
  411. movement_speed_multiplier = default.SLOW_SPEED_GRASS,
  412. })
  413. -- Does this node even exist in the world?
  414. minetest.register_node("default:dirt_with_grass_footsteps", {
  415. description = "Dirt With Grass And Footsteps",
  416. tiles = {
  417. "default_grass.png^default_footprint.png",
  418. "default_dirt.png",
  419. {name = "default_dirt.png^default_grass_side.png", tileable_vertical = false},
  420. },
  421. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, soil = 1, not_in_creative_inventory = 1}),
  422. drop = 'default:dirt',
  423. post_effect_color = {a=255, r=0, g=0, b=0},
  424. sounds = default.node_sound_dirt_defaults({
  425. footstep = {name = "default_grass_footstep", gain = 0.25},
  426. }),
  427. -- Depreciated.
  428. --on_timer = function(...)
  429. -- return dirtspread.dirt_on_timer(...)
  430. --end,
  431. on_finish_collapse = function(pos, node)
  432. minetest.swap_node(pos, {name="default:dirt"})
  433. end,
  434. movement_speed_multiplier = default.SLOW_SPEED_GRASS,
  435. })
  436. minetest.register_node("default:dirt_with_dry_grass", {
  437. description = "Dirt With Dry Grass",
  438. tiles = {
  439. "default_dry_grass.png",
  440. "default_dirt.png",
  441. {name = "default_dirt.png^default_dry_grass_side.png", tileable_vertical = false},
  442. },
  443. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, soil = 1}),
  444. drop = 'default:dirt',
  445. post_effect_color = {a=255, r=0, g=0, b=0},
  446. sounds = default.node_sound_dirt_defaults({
  447. footstep = {name = "default_grass_footstep", gain = 0.4},
  448. }),
  449. -- Depreciated.
  450. --on_timer = function(...)
  451. -- return dirtspread.dirt_on_timer(...)
  452. --end,
  453. on_finish_collapse = function(pos, node)
  454. minetest.swap_node(pos, {name="default:dirt"})
  455. end,
  456. movement_speed_multiplier = default.SLOW_SPEED_GRASS,
  457. })
  458. minetest.register_node("default:dirt_with_snow", {
  459. description = "Dirt With Snow",
  460. tiles = {
  461. "default_snow.png",
  462. "default_dirt.png",
  463. {name = "default_dirt.png^default_snow_side.png", tileable_vertical = false},
  464. },
  465. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, snowy_dirt_type = 1, snowy = 1, cold = 1}),
  466. drop = 'default:dirt',
  467. post_effect_color = {a=255, r=0, g=0, b=0},
  468. sounds = default.node_sound_dirt_defaults({
  469. footstep = {name = "default_snow_footstep", gain = 0.2},
  470. }),
  471. -- Depreciated.
  472. --on_timer = function(...)
  473. -- return dirtspread.dirt_on_timer(...)
  474. --end,
  475. -- Dirt with snow does not need to turn back to dirt if it falls. After all, snow does not have roots that would be broken, unlike grass.
  476. --[[
  477. on_finish_collapse = function(pos, node)
  478. minetest.swap_node(pos, {name="default:dirt"})
  479. end,
  480. --]]
  481. movement_speed_multiplier = default.SLOW_SPEED,
  482. })
  483. minetest.register_node("default:dark_dirt_with_snow", {
  484. description = "Sterile Dirt With Snow",
  485. tiles = {
  486. "default_snow.png",
  487. "darkage_darkdirt.png",
  488. {name = "darkage_darkdirt.png^default_snow_side.png", tileable_vertical = false},
  489. },
  490. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, sterile_dirt_type = 1, snowy_dirt_type = 1, snowy = 1, cold = 1}),
  491. drop = 'darkage:darkdirt',
  492. post_effect_color = {a=255, r=0, g=0, b=0},
  493. sounds = default.node_sound_dirt_defaults({
  494. footstep = {name = "default_snow_footstep", gain = 0.2},
  495. }),
  496. -- Depreciated.
  497. --on_timer = function(...)
  498. -- return dirtspread.dirt_on_timer(...)
  499. --end,
  500. -- Dirt with snow does not need to turn back to dirt if it falls. After all, snow does not have roots that would be broken, unlike grass.
  501. --[[
  502. on_finish_collapse = function(pos, node)
  503. minetest.swap_node(pos, {name="darkage:darkdirt"})
  504. end,
  505. --]]
  506. movement_speed_multiplier = default.SLOW_SPEED,
  507. })
  508. minetest.register_node("default:dry_dirt_with_snow", {
  509. description = "Dry Dirt With Snow",
  510. tiles = {
  511. "default_snow.png",
  512. "default_dry_dirt.png",
  513. {name = "default_dry_dirt.png^default_snow_side.png", tileable_vertical = false},
  514. },
  515. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, dry_dirt_type = 1, snowy_dirt_type = 1, snowy = 1, cold = 1}),
  516. drop = 'default:dry_dirt',
  517. post_effect_color = {a=255, r=0, g=0, b=0},
  518. sounds = default.node_sound_dirt_defaults({
  519. footstep = {name = "default_snow_footstep", gain = 0.2},
  520. }),
  521. -- Depreciated.
  522. --on_timer = function(...)
  523. -- return dirtspread.dirt_on_timer(...)
  524. --end,
  525. -- Dirt with snow does not need to turn back to dirt if it falls. After all, snow does not have roots that would be broken, unlike grass.
  526. --[[
  527. on_finish_collapse = function(pos, node)
  528. minetest.swap_node(pos, {name="default:dry_dirt"})
  529. end,
  530. --]]
  531. movement_speed_multiplier = default.SLOW_SPEED,
  532. })
  533. minetest.register_node("default:dirt_with_rainforest_litter", {
  534. description = "Dirt With Leaf Litter",
  535. tiles = {
  536. "default_rainforest_litter.png",
  537. "default_dirt.png",
  538. {name = "default_dirt.png^default_rainforest_litter_side.png", tileable_vertical = false},
  539. },
  540. groups = utility.dig_groups("dirt", {falling_node = 1, dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, non_sterile_dirt_type = 1, soil = 1}),
  541. drop = "default:dirt",
  542. post_effect_color = {a=255, r=0, g=0, b=0},
  543. sounds = default.node_sound_dirt_defaults({
  544. footstep = {name = "default_grass_footstep", gain = 0.4},
  545. }),
  546. on_finish_collapse = function(pos, node)
  547. minetest.swap_node(pos, {name="default:dirt"})
  548. end,
  549. movement_speed_multiplier = default.SLOW_SPEED,
  550. })
  551. minetest.register_node("default:dark_dirt_with_rainforest_litter", {
  552. description = "Sterile Dirt With Leaf Litter",
  553. tiles = {
  554. "default_rainforest_litter.png",
  555. "darkage_darkdirt.png",
  556. {name = "darkage_darkdirt.png^default_rainforest_litter_side.png", tileable_vertical = false},
  557. },
  558. groups = utility.dig_groups("dirt", {dirt_type = 1, leafy_dirt_type = 1, non_raw_dirt_type = 1, sterile_dirt_type = 1, falling_node = 1}),
  559. drop = "darkage:darkdirt",
  560. post_effect_color = {a=255, r=0, g=0, b=0},
  561. sounds = default.node_sound_dirt_defaults({
  562. footstep = {name = "default_grass_footstep", gain = 0.4},
  563. }),
  564. on_finish_collapse = function(pos, node)
  565. minetest.swap_node(pos, {name="darkage:darkdirt"})
  566. end,
  567. movement_speed_multiplier = default.SLOW_SPEED,
  568. })
  569. minetest.register_node("default:dry_dirt_with_rainforest_litter", {
  570. description = "Dry Dirt With Leaf Litter",
  571. tiles = {
  572. "default_rainforest_litter.png",
  573. "default_dry_dirt.png",
  574. {name = "default_dry_dirt.png^default_rainforest_litter_side.png", tileable_vertical = false},
  575. },
  576. groups = utility.dig_groups("dirt", {dirt_type = 1, non_sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, dry_dirt_type = 1, falling_node = 1}),
  577. drop = "default:dry_dirt",
  578. post_effect_color = {a=255, r=0, g=0, b=0},
  579. sounds = default.node_sound_dirt_defaults(),
  580. on_finish_collapse = function(pos, node)
  581. minetest.swap_node(pos, {name="default:dry_dirt"})
  582. end,
  583. movement_speed_multiplier = default.SLOW_SPEED,
  584. })
  585. minetest.register_node("default:dirt_with_coniferous_litter", {
  586. description = "Dirt With Acidic Litter",
  587. tiles = {
  588. "default_coniferous_litter.png",
  589. "default_dirt.png",
  590. {name = "default_dirt.png^default_coniferous_litter_side.png", tileable_vertical = false},
  591. },
  592. groups = utility.dig_groups("dirt", {falling_node = 1, non_sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, dirt_type = 1, soil = 1}),
  593. drop = "default:dirt",
  594. post_effect_color = {a=255, r=0, g=0, b=0},
  595. sounds = default.node_sound_dirt_defaults({
  596. footstep = {name = "default_grass_footstep", gain = 0.4},
  597. }),
  598. on_finish_collapse = function(pos, node)
  599. minetest.swap_node(pos, {name="default:dirt"})
  600. end,
  601. movement_speed_multiplier = default.SLOW_SPEED,
  602. })
  603. minetest.register_node("default:dark_dirt_with_coniferous_litter", {
  604. description = "Sterile Dirt With Acidic Litter",
  605. tiles = {
  606. "default_coniferous_litter.png",
  607. "darkage_darkdirt.png",
  608. {name = "darkage_darkdirt.png^default_coniferous_litter_side.png", tileable_vertical = false},
  609. },
  610. groups = utility.dig_groups("dirt", {dirt_type = 1, sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, falling_node = 1}),
  611. drop = "darkage:darkdirt",
  612. post_effect_color = {a=255, r=0, g=0, b=0},
  613. sounds = default.node_sound_dirt_defaults({
  614. footstep = {name = "default_grass_footstep", gain = 0.4},
  615. }),
  616. on_finish_collapse = function(pos, node)
  617. minetest.swap_node(pos, {name="darkage:darkdirt"})
  618. end,
  619. movement_speed_multiplier = default.SLOW_SPEED,
  620. })
  621. minetest.register_node("default:dry_dirt_with_coniferous_litter", {
  622. description = "Dry Dirt With Acidic Litter",
  623. tiles = {
  624. "default_coniferous_litter.png",
  625. "default_dry_dirt.png",
  626. {name = "default_dry_dirt.png^default_coniferous_litter_side.png", tileable_vertical = false},
  627. },
  628. groups = utility.dig_groups("dirt", {dirt_type = 1, non_sterile_dirt_type = 1, non_raw_dirt_type = 1, leafy_dirt_type = 1, dry_dirt_type = 1, falling_node = 1}),
  629. drop = "default:dry_dirt",
  630. post_effect_color = {a=255, r=0, g=0, b=0},
  631. sounds = default.node_sound_dirt_defaults(),
  632. on_finish_collapse = function(pos, node)
  633. minetest.swap_node(pos, {name="default:dry_dirt"})
  634. end,
  635. movement_speed_multiplier = default.SLOW_SPEED,
  636. })
  637. minetest.register_node("default:dry_dirt", {
  638. description = "Dry Dirt",
  639. tiles = {"default_dry_dirt.png"},
  640. groups = utility.dig_groups("dirt", {dirt_type = 1, dry_dirt_type = 1, non_sterile_dirt_type = 1, raw_dirt_type = 1, falling_node = 1}),
  641. post_effect_color = {a=255, r=0, g=0, b=0},
  642. sounds = default.node_sound_dirt_defaults(),
  643. movement_speed_multiplier = default.SLOW_SPEED,
  644. })
  645. minetest.register_node("default:dry_dirt_with_dry_grass", {
  646. description = "Dry Dirt With Dry Grass",
  647. tiles = {
  648. "default_dry_grass.png",
  649. "default_dry_dirt.png",
  650. {name = "default_dry_dirt.png^default_dry_grass_side.png", tileable_vertical = false},
  651. },
  652. groups = utility.dig_groups("dirt", {dirt_type = 1, dry_dirt_type = 1, non_raw_dirt_type = 1, non_sterile_dirt_type = 1, grassy_dirt_type = 1, falling_node = 1}),
  653. drop = "default:dry_dirt",
  654. post_effect_color = {a=255, r=0, g=0, b=0},
  655. sounds = default.node_sound_dirt_defaults({
  656. footstep = {name = "default_grass_footstep", gain = 0.4},
  657. }),
  658. on_finish_collapse = function(pos, node)
  659. minetest.swap_node(pos, {name="default:dry_dirt"})
  660. end,
  661. movement_speed_multiplier = default.SLOW_SPEED,
  662. })
  663. minetest.register_node("default:permafrost", {
  664. description = "Permafrost",
  665. tiles = {"default_permafrost.png"},
  666. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  667. sounds = default.node_sound_dirt_defaults(),
  668. movement_speed_multiplier = default.SLOW_SPEED,
  669. })
  670. minetest.register_node("default:permafrost_with_snow", {
  671. description = "Permafrost With Snow",
  672. tiles = {
  673. "default_snow.png",
  674. "default_permafrost.png",
  675. {name = "default_permafrost.png^default_snow_side.png", tileable_vertical = false},
  676. },
  677. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1, snowy = 1}),
  678. sounds = default.node_sound_dirt_defaults(),
  679. movement_speed_multiplier = default.SLOW_SPEED,
  680. })
  681. minetest.register_node("default:permafrost_with_stones", {
  682. description = "Permafrost With Stones",
  683. tiles = {
  684. "default_permafrost.png^default_stones.png",
  685. "default_permafrost.png",
  686. "default_permafrost.png^default_stones_side.png",
  687. },
  688. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  689. sounds = default.node_sound_gravel_defaults(),
  690. movement_speed_multiplier = default.SLOW_SPEED,
  691. })
  692. minetest.register_node("default:permafrost_with_snow_and_stones", {
  693. description = "Permafrost With Snow And Stones",
  694. tiles = {
  695. "default_permafrost.png^default_snow.png^default_stones.png",
  696. "default_permafrost.png",
  697. "default_permafrost.png^default_snow_side.png^default_stones_side.png",
  698. },
  699. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1, snowy = 1}),
  700. sounds = default.node_sound_gravel_defaults(),
  701. movement_speed_multiplier = default.SLOW_SPEED,
  702. })
  703. minetest.register_node("default:permafrost_with_moss", {
  704. description = "Permafrost With Moss",
  705. tiles = {
  706. "default_moss.png",
  707. "default_permafrost.png",
  708. {name = "default_permafrost.png^default_moss_side.png", tileable_vertical = false},
  709. },
  710. drop = "default:permafrost",
  711. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  712. sounds = default.node_sound_dirt_defaults({
  713. footstep = {name = "default_grass_footstep", gain = 0.25},
  714. }),
  715. on_finish_collapse = function(pos, node)
  716. minetest.swap_node(pos, {name="default:permafrost"})
  717. end,
  718. movement_speed_multiplier = default.SLOW_SPEED,
  719. })
  720. minetest.register_node("default:permafrost_with_moss_and_stones", {
  721. description = "Permafrost With Moss And Stones",
  722. tiles = {
  723. "default_moss.png^default_stones.png",
  724. "default_permafrost.png",
  725. {name = "default_permafrost.png^default_moss_side.png^default_stones_side.png", tileable_vertical = false},
  726. },
  727. drop = "default:permafrost_with_stones",
  728. groups = utility.dig_groups("cobble", {permafrost_type = 1, falling_node = 1, cold = 1}),
  729. sounds = default.node_sound_dirt_defaults({
  730. footstep = {name = "default_grass_footstep", gain = 0.25},
  731. }),
  732. on_finish_collapse = function(pos, node)
  733. minetest.swap_node(pos, {name="default:permafrost_with_stones"})
  734. end,
  735. movement_speed_multiplier = default.SLOW_SPEED,
  736. })
  737. minetest.register_node("default:sand", {
  738. description = "Sand",
  739. tiles = {"default_sand.png"},
  740. groups = utility.dig_groups("sand", {falling_node = 1, sand = 1, fall_damage_add_percent = -20}),
  741. post_effect_color = {a=255, r=0, g=0, b=0},
  742. sounds = default.node_sound_sand_defaults(),
  743. movement_speed_multiplier = default.SLOW_SPEED,
  744. })
  745. minetest.register_node("default:desert_sand", {
  746. description = "Desert Sand",
  747. tiles = {"default_desert_sand.png"},
  748. groups = utility.dig_groups("sand", {falling_node = 1, sand = 1, fall_damage_add_percent = -20}),
  749. sounds = default.node_sound_sand_defaults(),
  750. movement_speed_multiplier = default.SLOW_SPEED,
  751. })
  752. minetest.register_node("default:gravel", {
  753. description = "Gravel",
  754. tiles = {"default_gravel.png"},
  755. groups = utility.dig_groups("gravel", {falling_node = 1, gravel = 1}),
  756. sounds = default.node_sound_gravel_defaults(),
  757. drop = {
  758. max_items = 1,
  759. items = {
  760. {items = {'default:flint'}, rarity = 16},
  761. {items = {'default:gravel'}}
  762. }
  763. },
  764. post_effect_color = {a=255, r=0, g=0, b=0},
  765. -- Gravel is a component of wisp nests in Jarkati.
  766. after_destruct = function(pos, oldnode)
  767. local a = vector_add(pos, {x=0, y=1, z=0})
  768. local n = minetest.get_node(a)
  769. if n.name == "pm:spawner" then
  770. minetest.remove_node(a)
  771. end
  772. end,
  773. })
  774. minetest.register_node("default:clay", {
  775. description = "Clay",
  776. tiles = {"default_clay.png"},
  777. groups = utility.dig_groups("clay"),
  778. drop = 'default:clay_lump 4',
  779. sounds = default.node_sound_dirt_defaults(),
  780. movement_speed_multiplier = default.SLOW_SPEED,
  781. })
  782. minetest.register_node("default:snowblock", {
  783. description = "Snow Block",
  784. tiles = {"default_snow.png"},
  785. groups = utility.dig_groups("sand", {
  786. puts_out_fire = 1,
  787. snow = 1,
  788. snowy = 1,
  789. cold = 1,
  790. falling_node = 1,
  791. melts = 1,
  792. fall_damage_add_percent = -20,
  793. -- Currently used to notify ice nodes.
  794. notify_construct = 1,
  795. want_notify = 1,
  796. }),
  797. movement_speed_multiplier = default.SLOW_SPEED,
  798. _melts_to = "default:water_flowing",
  799. --damage_per_second = 2,
  800. post_effect_color = {a=255, r=255, g=255, b=255},
  801. sounds = default.node_sound_snow_defaults(),
  802. -- Hack to notify self.
  803. on_construct = function(pos)
  804. minetest.get_node_timer(pos):start(math_random(ice.minmax_time()))
  805. end,
  806. on_notify = function(...)
  807. return ice.on_ice_notify(...)
  808. end,
  809. on_timer = function(pos, elapsed)
  810. if rc.ice_melts_at_pos(pos) then
  811. minetest.add_node(pos, {name="default:water_flowing"})
  812. return
  813. end
  814. return ice.on_ice_timer(pos, elapsed)
  815. end,
  816. })
  817. minetest.register_node("default:ice", {
  818. description = "Ice",
  819. tiles = {"default_ice.png"},
  820. is_ground_content = false,
  821. paramtype = "light",
  822. groups = utility.dig_groups("ice", {
  823. ice = 1,
  824. cold = 1,
  825. --puts_out_fire = 1,
  826. melts = 1,
  827. want_notify = 1,
  828. slippery = 3,
  829. }),
  830. _melts_to = "default:water_flowing",
  831. sounds = default.node_sound_glass_defaults(),
  832. movement_speed_multiplier = default.SLOW_SPEED_ICE,
  833. -- Common ice does not count toward tool's dig count.
  834. _toolranks = {
  835. ignore = true,
  836. },
  837. _no_auto_pop = true,
  838. -- Hack to notify self.
  839. on_construct = function(pos)
  840. minetest.get_node_timer(pos):start(math_random(ice.minmax_time()))
  841. end,
  842. on_notify = function(...)
  843. return ice.on_ice_notify(...)
  844. end,
  845. on_timer = function(pos, elapsed)
  846. if rc.ice_melts_at_pos(pos) then
  847. minetest.add_node(pos, {name="default:water_flowing"})
  848. return
  849. end
  850. return ice.on_ice_timer(pos, elapsed)
  851. end,
  852. })
  853. --
  854. -- Trees
  855. --
  856. --
  857. -- Ores
  858. --
  859. minetest.register_node("default:stone_with_coal", {
  860. description = "Coal Deposit",
  861. tiles = {"default_stone.png^default_mineral_coal.png"},
  862. -- Cannot be flammable (although I would like it to be)
  863. -- because that interferes with TNT mining (the TNT replaces
  864. -- all coal with flame instead of dropping it).
  865. groups = utility.dig_groups("mineral"),
  866. drop = 'default:coal_lump',
  867. silverpick_drop = true,
  868. sounds = default.node_sound_stone_defaults(),
  869. place_param2 = 10,
  870. -- Digging coal ore has a chance to release poison gas.
  871. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  872. if pos.y < -1024 then
  873. if math_random(1, 300) == 1 then
  874. breath.spawn_gas(pos)
  875. end
  876. end
  877. end,
  878. })
  879. minetest.register_node("default:desert_stone_with_coal", {
  880. description = "Redstone Coal Deposit",
  881. tiles = {"default_desert_stone.png^default_mineral_coal2.png"},
  882. -- Cannot be flammable (although I would like it to be)
  883. -- because that interferes with TNT mining (the TNT replaces
  884. -- all coal with flame instead of dropping it).
  885. groups = utility.dig_groups("mineral"),
  886. drop = 'default:coal_lump',
  887. silverpick_drop = true,
  888. sounds = default.node_sound_stone_defaults(),
  889. place_param2 = 10,
  890. })
  891. minetest.register_node("default:coalblock", {
  892. description = "Coal Block",
  893. tiles = {"default_coal_block.png"},
  894. is_ground_content = false,
  895. groups = utility.dig_groups("cobble", {flammable = 3}),
  896. sounds = default.node_sound_stone_defaults(),
  897. })
  898. minetest.register_node("default:stone_with_iron", {
  899. description = "Iron Ore",
  900. tiles = {"default_stone.png^default_mineral_iron.png"},
  901. groups = utility.dig_groups("mineral", {ore = 1}),
  902. drop = 'default:iron_lump',
  903. silverpick_drop = true,
  904. sounds = default.node_sound_stone_defaults(),
  905. place_param2 = 10,
  906. })
  907. minetest.register_node("default:steelblock", {
  908. description = "Wrought Iron Block",
  909. tiles = {"default_steel_block.png"},
  910. is_ground_content = false,
  911. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  912. sounds = default.node_sound_metal_defaults(),
  913. })
  914. minetest.register_node("default:stone_with_copper", {
  915. description = "Copper Ore",
  916. tiles = {"default_stone.png^default_mineral_copper.png"},
  917. groups = utility.dig_groups("mineral", {ore = 1}),
  918. drop = 'default:copper_lump',
  919. silverpick_drop = true,
  920. sounds = default.node_sound_stone_defaults(),
  921. place_param2 = 10,
  922. })
  923. minetest.register_node("default:desert_stone_with_copper", {
  924. description = "Redstone Copper Ore",
  925. -- Use old copper image, the pattern looks nicer.
  926. tiles = {"default_desert_stone.png^default_mineral_copper2.png"},
  927. groups = utility.dig_groups("mineral", {ore = 1}),
  928. drop = 'default:copper_lump',
  929. silverpick_drop = true,
  930. sounds = default.node_sound_stone_defaults(),
  931. place_param2 = 10,
  932. })
  933. minetest.register_node("default:desert_stone_with_iron", {
  934. description = "Redstone Iron Ore",
  935. -- Use old iron image, the pattern looks nicer.
  936. tiles = {"default_desert_stone.png^default_mineral_iron2.png"},
  937. groups = utility.dig_groups("mineral", {ore = 1}),
  938. drop = 'default:iron_lump',
  939. silverpick_drop = true,
  940. sounds = default.node_sound_stone_defaults(),
  941. place_param2 = 10,
  942. })
  943. minetest.register_node("default:desert_stone_with_diamond", {
  944. description = "Redstone Diamond Deposit",
  945. -- Use old diamond image, the pattern looks nicer.
  946. tiles = {"default_desert_stone.png^default_mineral_diamond2.png"},
  947. groups = utility.dig_groups("hardmineral"),
  948. drop = 'default:diamond',
  949. silverpick_drop = true,
  950. sounds = default.node_sound_stone_defaults(),
  951. place_param2 = 10,
  952. })
  953. minetest.register_node("default:copperblock", {
  954. description = "Copper Block",
  955. tiles = {"default_copper_block.png"},
  956. is_ground_content = false,
  957. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  958. sounds = default.node_sound_metal_defaults(),
  959. })
  960. minetest.register_node("default:bronzeblock", {
  961. description = "Bronze Block",
  962. tiles = {"default_bronze_block.png"},
  963. is_ground_content = false,
  964. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  965. sounds = default.node_sound_metal_defaults(),
  966. })
  967. minetest.register_node("default:stone_with_mese", {
  968. description = "Mese Ore",
  969. tiles = {"default_stone.png^default_mineral_mese.png"},
  970. groups = utility.dig_groups("hardmineral", {melts = 1}),
  971. drop = "default:mese_crystal",
  972. silverpick_drop = true,
  973. sounds = default.node_sound_stone_defaults(),
  974. -- Mese in stone reacts badly to lava.
  975. on_melt = function(pos, other)
  976. minetest.after(0, function()
  977. tnt.boom(pos, {
  978. radius = 4,
  979. ignore_protection = false,
  980. ignore_on_blast = false,
  981. damage_radius = 6,
  982. disable_drops = true,
  983. })
  984. end)
  985. end,
  986. })
  987. minetest.register_node("default:mese", {
  988. description = "Mese Block",
  989. tiles = {"default_mese_block.png"},
  990. paramtype = "light",
  991. groups = utility.dig_groups("hardstone", {melts = 1}),
  992. sounds = default.node_sound_stone_defaults(),
  993. light_source = 3,
  994. -- Mese in stone reacts badly to lava.
  995. -- Meseblock makes a much larger blast.
  996. on_melt = function(pos, other)
  997. minetest.after(0, function()
  998. tnt.boom(pos, {
  999. radius = 10,
  1000. ignore_protection = false,
  1001. ignore_on_blast = false,
  1002. damage_radius = 20,
  1003. disable_drops = true,
  1004. })
  1005. end)
  1006. end,
  1007. })
  1008. minetest.register_node("default:stone_with_gold", {
  1009. description = "Gold Ore",
  1010. tiles = {"default_stone.png^default_mineral_gold.png"},
  1011. groups = utility.dig_groups("mineral", {ore = 1}),
  1012. drop = "default:gold_lump",
  1013. silverpick_drop = true,
  1014. sounds = default.node_sound_stone_defaults(),
  1015. place_param2 = 10,
  1016. })
  1017. minetest.register_node("default:goldblock", {
  1018. description = "Gold Block",
  1019. tiles = {"default_gold_block.png"},
  1020. is_ground_content = false,
  1021. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  1022. sounds = default.node_sound_metal_defaults(),
  1023. })
  1024. minetest.register_node("default:stone_with_diamond", {
  1025. description = "Diamond Deposit",
  1026. tiles = {"default_stone.png^default_mineral_diamond.png"},
  1027. -- Player has to get mese pick or similar before they can get diamond.
  1028. groups = utility.dig_groups("hardmineral"),
  1029. drop = "default:diamond",
  1030. silverpick_drop = true,
  1031. sounds = default.node_sound_stone_defaults(),
  1032. place_param2 = 10,
  1033. })
  1034. minetest.register_node("default:diamondblock", {
  1035. description = "Diamond Block",
  1036. tiles = {"default_diamond_block.png"},
  1037. is_ground_content = false,
  1038. groups = utility.dig_groups("obsidian"),
  1039. sounds = default.node_sound_stone_defaults(),
  1040. })
  1041. --
  1042. -- Plantlife (non-cubic)
  1043. --
  1044. do
  1045. local nodebox = {
  1046. -- Spine strips.
  1047. {0, 1, 1, 16, 15, 1},
  1048. {0, 1, 15, 16, 15, 15},
  1049. {1, 1, 0, 1, 15, 16},
  1050. {15, 1, 0, 15, 15, 16},
  1051. -- Meat.
  1052. {1, 0, 1, 15, 16, 15},
  1053. -- Side skin.
  1054. {4, 0, 0, 12, 16, 16},
  1055. {0, 0, 4, 16, 16, 12},
  1056. }
  1057. local selectionbox = {
  1058. {1, 0, 1, 15, 16, 15},
  1059. }
  1060. utility.transform_nodebox(nodebox)
  1061. utility.transform_nodebox(selectionbox)
  1062. minetest.register_node("default:cactus", {
  1063. description = "Cactus",
  1064. tiles = {
  1065. "default_cactus_top.png",
  1066. "default_cactus_top.png",
  1067. "default_cactus_side.png"
  1068. },
  1069. paramtype = "light",
  1070. drawtype = "nodebox",
  1071. node_box = {
  1072. type = "fixed",
  1073. fixed = nodebox,
  1074. },
  1075. selection_box = {
  1076. type = "fixed",
  1077. fixed = selectionbox,
  1078. },
  1079. paramtype2 = "facedir",
  1080. groups = utility.dig_groups("softwood", {flammable = 1, fall_damage_add_percent = 100}),
  1081. sounds = default.node_sound_wood_defaults(),
  1082. on_place = minetest.rotate_node,
  1083. damage_per_second = 1,
  1084. on_punch = function(pos, node, puncher, pt)
  1085. if not puncher or not puncher:is_player() then return end
  1086. local stack = puncher:get_wielded_item()
  1087. local name = stack:get_name() or ""
  1088. if not string.find(name, "axe") then
  1089. puncher:set_hp(puncher:get_hp() - 1)
  1090. end
  1091. end,
  1092. on_player_walk_over = function(pos, player)
  1093. player:set_hp(player:get_hp() - 1)
  1094. if player:get_hp() == 0 then
  1095. minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on cactus. Noob!")
  1096. end
  1097. end,
  1098. on_construct = function(...)
  1099. return cactus.on_construct(...)
  1100. end,
  1101. on_destruct = function(...)
  1102. return cactus.on_destruct(...)
  1103. end,
  1104. on_timer = function(...)
  1105. return cactus.on_timer(...)
  1106. end,
  1107. after_dig_node = function(...)
  1108. return cactus.after_dig_node(...)
  1109. end,
  1110. })
  1111. end
  1112. --[[
  1113. --= Tests of Tools Against Default Groups =--
  1114. result_of {snappy = 1, choppy = 3} + tool=default:axe_stone : digsound=success
  1115. result_of {snappy = 1, choppy = 3} + tool=default:axe_diamond : digsound=success
  1116. result_of {snappy = 1, choppy = 3} + tool=default:axe_steel : digsound=success
  1117. result_of {snappy = 1, choppy = 3} + tool=default:axe_mese : digsound=success
  1118. result_of {snappy = 1, choppy = 3} + tool=default:sword_steel : digsound=failure
  1119. result_of {snappy = 1, choppy = 3} + tool=default:sword_stone : digsound=N/A (could not dig)
  1120. result_of {snappy = 1, choppy = 3} + tool=default:sword_diamond : digsound=failure
  1121. result_of {snappy = 1, choppy = 3} + tool=default:sword_mese : digsound=failure
  1122. result_of {snappy = 1, choppy = 3} + tool=default:shovel_stone : digsound=N/A (could not dig)
  1123. result_of {snappy = 1, choppy = 3} + tool=default:shovel_steel : digsound=N/A (could not dig)
  1124. result_of {snappy = 1, choppy = 3} + tool=default:shovel_diamond : digsound=N/A (could not dig)
  1125. result_of {snappy = 1, choppy = 3} + tool=default:shovel_mese : digsound=N/A (could not dig)
  1126. result_of {snappy = 1, choppy = 3} + tool=default:pick_stone : digsound=N/A (could not dig)
  1127. result_of {snappy = 1, choppy = 3} + tool=default:pick_steel : digsound=N/A (could not dig)
  1128. result_of {snappy = 1, choppy = 3} + tool=default:pick_diamond : digsound=N/A (could not dig)
  1129. result_of {snappy = 1, choppy = 3} + tool=default:pick_mese : digsound=N/A (could not dig)
  1130. --= Tests of Tools Against Modified Groups (A) =--
  1131. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_stone : digsound=N/A (could not dig)
  1132. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_steel : digsound=success
  1133. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_diamond : digsound=success
  1134. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_mese : digsound=success
  1135. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_stone : digsound=success
  1136. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_steel : digsound=success
  1137. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_diamond : digsound=success
  1138. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_mese : digsound=success
  1139. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_stone : digsound=N/A (could not dig)
  1140. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_steel : digsound=N/A (could not dig)
  1141. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_diamond : digsound=N/A (could not dig)
  1142. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_mese : digsound=N/A (could not dig)
  1143. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1144. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_steel : digsound=failure
  1145. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_diamond : digsound=failure
  1146. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_mese : digsound=failure
  1147. --= Tests of Tools Against Modified Groups (B) =--
  1148. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_stone : digsound=N/A (could not dig)
  1149. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_steel : digsound=success
  1150. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_diamond : digsound=success
  1151. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_mese : digsound=success
  1152. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_stone : digsound=success
  1153. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_steel : digsound=success
  1154. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_diamond : digsound=success
  1155. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_mese : digsound=success
  1156. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_stone : digsound=success
  1157. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_steel : digsound=success
  1158. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_diamond : digsound=success
  1159. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_mese : digsound=success
  1160. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1161. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_steel : digsound=failure
  1162. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_diamond : digsound=failure
  1163. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_mese : digsound=failure
  1164. --= Tests of Swords Against Modified Groups (C) =--
  1165. result_of {snappy = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1166. result_of {snappy = 1} + tool=default:sword_steel : digsound=failure
  1167. result_of {snappy = 1} + tool=default:sword_diamond : digsound=failure
  1168. result_of {snappy = 1} + tool=default:sword_mese : digsound=failure
  1169. --]]
  1170. minetest.register_node("default:papyrus", {
  1171. description = "Papyrus",
  1172. drawtype = "plantlike",
  1173. tiles = {"default_papyrus.png"},
  1174. inventory_image = "default_papyrus.png",
  1175. wield_image = "default_papyrus.png",
  1176. paramtype = "light",
  1177. sunlight_propagates = true,
  1178. walkable = false,
  1179. selection_box = {
  1180. type = "fixed",
  1181. fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
  1182. },
  1183. groups = utility.dig_groups("plant", {flammable = 2}),
  1184. sounds = default.node_sound_leaves_defaults(),
  1185. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1186. on_construct = function(...)
  1187. return papyrus.on_construct(...)
  1188. end,
  1189. on_destruct = function(...)
  1190. return papyrus.on_destruct(...)
  1191. end,
  1192. on_timer = function(...)
  1193. return papyrus.on_timer(...)
  1194. end,
  1195. after_dig_node = function(...)
  1196. return papyrus.after_dig_node(...)
  1197. end,
  1198. })
  1199. minetest.register_node("default:dry_shrub", {
  1200. description = "Dry Shrub",
  1201. drawtype = "plantlike",
  1202. waving = 1,
  1203. --visual_scale = 1.0,
  1204. tiles = {"default_dry_shrub.png"},
  1205. inventory_image = "default_dry_shrub.png",
  1206. wield_image = "default_dry_shrub.png",
  1207. paramtype = "light",
  1208. sunlight_propagates = true,
  1209. walkable = false,
  1210. buildable_to = true,
  1211. groups = utility.dig_groups("plant", {flammable = 3, attached_node = 1, dry_grass = 1}),
  1212. sounds = default.node_sound_leaves_defaults(),
  1213. selection_box = {
  1214. type = "fixed",
  1215. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1216. },
  1217. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1218. -- Drop 1 or 2 sticks.
  1219. drop = {
  1220. max_items = 1,
  1221. items = {
  1222. {items = {'default:stick 2'}, rarity = 2},
  1223. {items = {'default:stick'}},
  1224. }
  1225. },
  1226. shears_drop = true,
  1227. flowerpot_drop = "default:dry_shrub",
  1228. })
  1229. minetest.register_node("default:junglegrass", {
  1230. description = "Jungle Grass",
  1231. drawtype = "plantlike",
  1232. waving = 1,
  1233. visual_scale = 1.69,
  1234. tiles = {"default_junglegrass.png"},
  1235. inventory_image = "default_junglegrass.png",
  1236. wield_image = "default_junglegrass.png",
  1237. paramtype = "light",
  1238. paramtype2 = "meshoptions",
  1239. place_param2 = 2,
  1240. sunlight_propagates = true,
  1241. walkable = false,
  1242. buildable_to = true,
  1243. -- Default drops are defined in farming mod.
  1244. flowerpot_drop = "default:junglegrass",
  1245. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1}),
  1246. sounds = default.node_sound_leaves_defaults(),
  1247. selection_box = {
  1248. type = "fixed",
  1249. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1250. },
  1251. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1252. on_construct = function(...)
  1253. return flowers.on_flora_construct(...)
  1254. end,
  1255. on_destruct = function(...)
  1256. return flowers.on_flora_destruct(...)
  1257. end,
  1258. on_timer = function(...)
  1259. return flowers.on_flora_timer(...)
  1260. end,
  1261. on_punch = function(...)
  1262. return flowers.on_flora_punch(...)
  1263. end,
  1264. })
  1265. minetest.register_node("default:coarsegrass", {
  1266. description = "Coarse Grass",
  1267. drawtype = "plantlike",
  1268. waving = 1,
  1269. visual_scale = 1.0,
  1270. tiles = {"default_junglegrass_newstyle.png"},
  1271. inventory_image = "default_junglegrass_newstyle.png",
  1272. wield_image = "default_junglegrass_newstyle.png",
  1273. paramtype = "light",
  1274. paramtype2 = "meshoptions",
  1275. place_param2 = 2,
  1276. sunlight_propagates = true,
  1277. walkable = false,
  1278. buildable_to = true,
  1279. drop = "default:stick",
  1280. shears_drop = true,
  1281. flowerpot_drop = "default:coarsegrass",
  1282. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1}),
  1283. sounds = default.node_sound_leaves_defaults(),
  1284. selection_box = {
  1285. type = "fixed",
  1286. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1287. },
  1288. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1289. on_construct = function(...)
  1290. return flowers.on_flora_construct(...)
  1291. end,
  1292. on_destruct = function(...)
  1293. return flowers.on_flora_destruct(...)
  1294. end,
  1295. on_timer = function(...)
  1296. return flowers.on_flora_timer(...)
  1297. end,
  1298. on_punch = function(...)
  1299. return flowers.on_flora_punch(...)
  1300. end,
  1301. })
  1302. -- This node is not meant to be placed in the world.
  1303. -- Instead, placing it causes 1 of several other nodetypes to be placed instead.
  1304. minetest.register_node("default:grass_dummy", {
  1305. description = "Wild Grass\n\nA common field plant, sometimes containing seeds.\nCan be hung upside down like some herbs.",
  1306. drawtype = "plantlike",
  1307. waving = 1,
  1308. tiles = {"default_grass_1.png"},
  1309. -- Use texture of a taller grass stage in inventory
  1310. inventory_image = "default_grass_3.png",
  1311. wield_image = "default_grass_3.png",
  1312. paramtype = "light",
  1313. paramtype2 = "meshoptions",
  1314. place_param2 = 2,
  1315. sounds = default.node_sound_leaves_defaults(),
  1316. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1317. flowerpot_insert = {"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"},
  1318. -- Zero-width selection box.
  1319. selection_box = {
  1320. type = "fixed",
  1321. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1322. },
  1323. on_place = function(itemstack, placer, pt)
  1324. -- place a random grass node
  1325. -- If pointing to the ceiling place hanging grass.
  1326. --minetest.chat_send_all(dump(pt))
  1327. if pt.type == "node" then
  1328. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1329. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1330. if pt.under.y-1 == pt.above.y then
  1331. --minetest.chat_send_all("hanging!")
  1332. local stack = ItemStack("default:grass_" .. math_random(1,5) .. "_hanging")
  1333. local ret = minetest.item_place(stack, placer, pt)
  1334. return ItemStack("default:grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1335. end
  1336. end
  1337. local stack = ItemStack("default:grass_" .. math_random(1,5))
  1338. local ret = minetest.item_place(stack, placer, pt)
  1339. return ItemStack("default:grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1340. end,
  1341. })
  1342. for i = 1, 5 do
  1343. minetest.register_node("default:grass_" .. i, {
  1344. description = "Grass",
  1345. drawtype = "plantlike",
  1346. waving = 1,
  1347. tiles = {"default_grass_" .. i .. ".png"},
  1348. inventory_image = "default_grass_3.png",
  1349. wield_image = "default_grass_3.png",
  1350. paramtype = "light",
  1351. paramtype2 = "meshoptions",
  1352. place_param2 = 2,
  1353. sunlight_propagates = true,
  1354. walkable = false,
  1355. buildable_to = true,
  1356. -- Default drops are defined in farming mod.
  1357. flowerpot_drop = "default:grass_dummy",
  1358. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1, flammable = 1}),
  1359. sounds = default.node_sound_leaves_defaults(),
  1360. selection_box = {
  1361. type = "fixed",
  1362. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1363. },
  1364. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1365. on_construct = function(...)
  1366. return flowers.on_flora_construct(...)
  1367. end,
  1368. on_destruct = function(...)
  1369. return flowers.on_flora_destruct(...)
  1370. end,
  1371. on_timer = function(...)
  1372. return flowers.on_flora_timer(...)
  1373. end,
  1374. on_punch = function(...)
  1375. return flowers.on_flora_punch(...)
  1376. end,
  1377. })
  1378. end
  1379. for i = 1, 5 do
  1380. minetest.register_node("default:grass_" .. i .. "_hanging", {
  1381. description = "Hanging Grass",
  1382. drawtype = "plantlike",
  1383. -- Waving hanging nodes look ugly.
  1384. --waving = 1,
  1385. tiles = {"default_grass_" .. i .. ".png^[transformFY"},
  1386. inventory_image = "default_grass_3.png",
  1387. wield_image = "default_grass_3.png",
  1388. paramtype = "light",
  1389. paramtype2 = "meshoptions",
  1390. place_param2 = 2,
  1391. sunlight_propagates = true,
  1392. walkable = false,
  1393. buildable_to = true,
  1394. -- Default drops are defined in farming mod.
  1395. flowerpot_drop = "default:grass_dummy",
  1396. groups = utility.dig_groups("plant", {hanging_node = 1, not_in_creative_inventory = 1, grass = 1, flammable = 1}),
  1397. sounds = default.node_sound_leaves_defaults(),
  1398. selection_box = {
  1399. type = "fixed",
  1400. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1401. },
  1402. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1403. })
  1404. end
  1405. minetest.register_node("default:dry_grass_dummy", {
  1406. description = "Dry Grass",
  1407. drawtype = "plantlike",
  1408. waving = 1,
  1409. tiles = {"default_dry_grass_1.png"},
  1410. inventory_image = "default_dry_grass_3.png",
  1411. wield_image = "default_dry_grass_3.png",
  1412. paramtype = "light",
  1413. paramtype2 = "meshoptions",
  1414. place_param2 = 2,
  1415. sounds = default.node_sound_leaves_defaults(),
  1416. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1417. flowerpot_insert = {"default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"},
  1418. -- Zero-width selection box.
  1419. selection_box = {
  1420. type = "fixed",
  1421. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1422. },
  1423. on_place = function(itemstack, placer, pt)
  1424. -- place a random dry grass node
  1425. -- If pointing to the ceiling place hanging grass.
  1426. --minetest.chat_send_all(dump(pt))
  1427. if pt.type == "node" then
  1428. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1429. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1430. if pt.under.y-1 == pt.above.y then
  1431. --minetest.chat_send_all("hanging!")
  1432. local stack = ItemStack("default:dry_grass_" .. math_random(1,5) .. "_hanging")
  1433. local ret = minetest.item_place(stack, placer, pt)
  1434. return ItemStack("default:dry_grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1435. end
  1436. end
  1437. local stack = ItemStack("default:dry_grass_" .. math_random(1, 5))
  1438. local ret = minetest.item_place(stack, placer, pt)
  1439. return ItemStack("default:dry_grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1440. end,
  1441. })
  1442. for i = 1, 5 do
  1443. minetest.register_node("default:dry_grass_" .. i, {
  1444. description = "Dry Grass",
  1445. drawtype = "plantlike",
  1446. waving = 1,
  1447. tiles = {"default_dry_grass_" .. i .. ".png"},
  1448. inventory_image = "default_dry_grass_3.png",
  1449. wield_image = "default_dry_grass_3.png",
  1450. paramtype = "light",
  1451. paramtype2 = "meshoptions",
  1452. place_param2 = 2,
  1453. sunlight_propagates = true,
  1454. walkable = false,
  1455. buildable_to = true,
  1456. groups = utility.dig_groups("plant", {flammable = 3, flora = 1, attached_node = 1,
  1457. not_in_creative_inventory=1, dry_grass = 1}),
  1458. drop = "",
  1459. shears_drop = "default:dry_grass_dummy",
  1460. flowerpot_drop = "default:dry_grass_dummy",
  1461. sounds = default.node_sound_leaves_defaults(),
  1462. selection_box = {
  1463. type = "fixed",
  1464. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1465. },
  1466. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1467. on_construct = function(...)
  1468. return flowers.on_flora_construct(...)
  1469. end,
  1470. on_destruct = function(...)
  1471. return flowers.on_flora_destruct(...)
  1472. end,
  1473. on_timer = function(...)
  1474. return flowers.on_flora_timer(...)
  1475. end,
  1476. on_punch = function(...)
  1477. return flowers.on_flora_punch(...)
  1478. end,
  1479. })
  1480. end
  1481. for i = 1, 5 do
  1482. minetest.register_node("default:dry_grass_" .. i .. "_hanging", {
  1483. description = "Dry Grass",
  1484. drawtype = "plantlike",
  1485. -- Waving hanging grass looks silly.
  1486. --waving = 1,
  1487. tiles = {"default_dry_grass_" .. i .. ".png^[transformFY"},
  1488. inventory_image = "default_dry_grass_3.png",
  1489. wield_image = "default_dry_grass_3.png",
  1490. paramtype = "light",
  1491. paramtype2 = "meshoptions",
  1492. place_param2 = 2,
  1493. sunlight_propagates = true,
  1494. walkable = false,
  1495. buildable_to = true,
  1496. -- Not in flora group, since it does not need to spread.
  1497. groups = utility.dig_groups("plant", {flammable = 3, hanging_node = 1,
  1498. not_in_creative_inventory=1, dry_grass = 1}),
  1499. drop = "",
  1500. shears_drop = "default:dry_grass_dummy",
  1501. flowerpot_drop = "default:dry_grass_dummy",
  1502. sounds = default.node_sound_leaves_defaults(),
  1503. selection_box = {
  1504. type = "fixed",
  1505. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1506. },
  1507. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1508. })
  1509. end
  1510. minetest.register_node("default:dry_grass2_dummy", {
  1511. description = "Dry Grass",
  1512. drawtype = "plantlike",
  1513. waving = 1,
  1514. tiles = {"default_dry_grass2_1.png"},
  1515. inventory_image = "default_dry_grass2_3.png",
  1516. wield_image = "default_dry_grass2_3.png",
  1517. paramtype = "light",
  1518. paramtype2 = "meshoptions",
  1519. place_param2 = 2,
  1520. sounds = default.node_sound_leaves_defaults(),
  1521. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1522. flowerpot_insert = {"default:dry_grass2_1", "default:dry_grass2_2", "default:dry_grass2_3", "default:dry_grass2_4", "default:dry_grass2_5"},
  1523. -- Zero-width selection box.
  1524. selection_box = {
  1525. type = "fixed",
  1526. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1527. },
  1528. on_place = function(itemstack, placer, pt)
  1529. -- place a random dry grass node
  1530. -- If pointing to the ceiling place hanging grass.
  1531. --minetest.chat_send_all(dump(pt))
  1532. if pt.type == "node" then
  1533. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1534. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1535. if pt.under.y-1 == pt.above.y then
  1536. --minetest.chat_send_all("hanging!")
  1537. local stack = ItemStack("default:dry_grass2_" .. math_random(1,5) .. "_hanging")
  1538. local ret = minetest.item_place(stack, placer, pt)
  1539. return ItemStack("default:dry_grass2_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1540. end
  1541. end
  1542. local stack = ItemStack("default:dry_grass2_" .. math_random(1, 5))
  1543. local ret = minetest.item_place(stack, placer, pt)
  1544. return ItemStack("default:dry_grass2_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1545. end,
  1546. })
  1547. for i = 1, 5 do
  1548. minetest.register_node("default:dry_grass2_" .. i, {
  1549. description = "Dry Grass",
  1550. drawtype = "plantlike",
  1551. waving = 1,
  1552. tiles = {"default_dry_grass2_" .. i .. ".png"},
  1553. inventory_image = "default_dry_grass2_3.png",
  1554. wield_image = "default_dry_grass2_3.png",
  1555. paramtype = "light",
  1556. paramtype2 = "meshoptions",
  1557. place_param2 = 2,
  1558. sunlight_propagates = true,
  1559. walkable = false,
  1560. buildable_to = true,
  1561. groups = utility.dig_groups("plant", {flammable = 3, flora = 1, attached_node = 1,
  1562. not_in_creative_inventory=1, dry_grass = 1}),
  1563. drop = "",
  1564. shears_drop = "default:dry_grass2_dummy",
  1565. flowerpot_drop = "default:dry_grass2_dummy",
  1566. sounds = default.node_sound_leaves_defaults(),
  1567. selection_box = {
  1568. type = "fixed",
  1569. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1570. },
  1571. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1572. on_construct = function(...)
  1573. return flowers.on_flora_construct(...)
  1574. end,
  1575. on_destruct = function(...)
  1576. return flowers.on_flora_destruct(...)
  1577. end,
  1578. on_timer = function(...)
  1579. return flowers.on_flora_timer(...)
  1580. end,
  1581. on_punch = function(...)
  1582. return flowers.on_flora_punch(...)
  1583. end,
  1584. })
  1585. end
  1586. for i = 1, 5 do
  1587. minetest.register_node("default:dry_grass2_" .. i .. "_hanging", {
  1588. description = "Dry Grass",
  1589. drawtype = "plantlike",
  1590. -- Waving hanging grass looks silly.
  1591. --waving = 1,
  1592. tiles = {"default_dry_grass2_" .. i .. ".png^[transformFY"},
  1593. inventory_image = "default_dry_grass2_3.png",
  1594. wield_image = "default_dry_grass2_3.png",
  1595. paramtype = "light",
  1596. paramtype2 = "meshoptions",
  1597. place_param2 = 2,
  1598. sunlight_propagates = true,
  1599. walkable = false,
  1600. buildable_to = true,
  1601. -- Not in flora group, since it does not need to spread.
  1602. groups = utility.dig_groups("plant", {flammable = 3, hanging_node = 1,
  1603. not_in_creative_inventory=1, dry_grass = 1}),
  1604. drop = "",
  1605. shears_drop = "default:dry_grass2_dummy",
  1606. flowerpot_drop = "default:dry_grass2_dummy",
  1607. sounds = default.node_sound_leaves_defaults(),
  1608. selection_box = {
  1609. type = "fixed",
  1610. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1611. },
  1612. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1613. })
  1614. end
  1615. --
  1616. -- Liquids
  1617. --
  1618. minetest.register_node("default:water_source", {
  1619. description = "Water Source",
  1620. drawtype = "liquid",
  1621. tiles = {
  1622. {
  1623. name = "default_water_source_animated.png",
  1624. animation = {
  1625. type = "vertical_frames",
  1626. aspect_w = 16,
  1627. aspect_h = 16,
  1628. length = 2.0,
  1629. },
  1630. },
  1631. },
  1632. special_tiles = {
  1633. -- New-style water source material (mostly unused)
  1634. {
  1635. name = "default_water_source_animated.png",
  1636. animation = {
  1637. type = "vertical_frames",
  1638. aspect_w = 16,
  1639. aspect_h = 16,
  1640. length = 2.0,
  1641. },
  1642. backface_culling = false,
  1643. },
  1644. },
  1645. alpha = 160,
  1646. paramtype = "light",
  1647. walkable = false,
  1648. pointable = false,
  1649. diggable = false,
  1650. buildable_to = true,
  1651. is_ground_content = false,
  1652. drop = "",
  1653. drowning = 4,
  1654. liquidtype = "source",
  1655. liquid_alternative_flowing = "default:water_flowing",
  1656. liquid_alternative_source = "default:water_source",
  1657. liquid_viscosity = 1,
  1658. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1659. groups = {water = 3, liquid = 3, puts_out_fire = 1},
  1660. sounds = default.node_sound_water_defaults(),
  1661. -- Water turns to fire in the nether.
  1662. -- Note: this is not called if water-source is created by the engine due to liquid-flow mechanic.
  1663. on_construct = function(pos)
  1664. farming.notify_soil(pos)
  1665. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1666. minetest.add_node(pos, {name="fire:basic_flame"})
  1667. return
  1668. end
  1669. if rc.current_realm_at_pos(pos) == "channelwood" then
  1670. minetest.swap_node(pos, {name="cw:water_source"})
  1671. return
  1672. end
  1673. if pos.y < -25000 then
  1674. minetest.add_node(pos, {name="fire:basic_flame"})
  1675. end
  1676. end,
  1677. on_destruct = function(pos)
  1678. farming.notify_soil(pos)
  1679. end,
  1680. on_collapse_to_entity = function(pos, node)
  1681. -- Do not allow player to obtain the node itself.
  1682. end,
  1683. })
  1684. minetest.register_node("default:water_flowing", {
  1685. description = "Flowing Water",
  1686. drawtype = "flowingliquid",
  1687. tiles = {"default_water.png"},
  1688. special_tiles = {
  1689. {
  1690. name = "default_water_flowing_animated.png",
  1691. backface_culling = false,
  1692. animation = {
  1693. type = "vertical_frames",
  1694. aspect_w = 16,
  1695. aspect_h = 16,
  1696. length = 0.8,
  1697. },
  1698. },
  1699. {
  1700. name = "default_water_flowing_animated.png",
  1701. backface_culling = true,
  1702. animation = {
  1703. type = "vertical_frames",
  1704. aspect_w = 16,
  1705. aspect_h = 16,
  1706. length = 0.8,
  1707. },
  1708. },
  1709. },
  1710. alpha = 160,
  1711. paramtype = "light",
  1712. paramtype2 = "flowingliquid",
  1713. walkable = false,
  1714. pointable = false,
  1715. diggable = false,
  1716. buildable_to = true,
  1717. is_ground_content = false,
  1718. drop = "",
  1719. drowning = 4,
  1720. liquidtype = "flowing",
  1721. liquid_alternative_flowing = "default:water_flowing",
  1722. liquid_alternative_source = "default:water_source",
  1723. liquid_viscosity = 1,
  1724. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1725. groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
  1726. sounds = default.node_sound_water_defaults(),
  1727. on_collapse_to_entity = function(pos, node)
  1728. -- Do not allow player to obtain the node itself.
  1729. end,
  1730. on_construct = function(pos)
  1731. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1732. minetest.add_node(pos, {name="fire:basic_flame"})
  1733. return
  1734. end
  1735. if rc.current_realm_at_pos(pos) == "channelwood" then
  1736. minetest.swap_node(pos, {name="cw:water_flowing"})
  1737. return
  1738. end
  1739. if pos.y < -25000 then
  1740. minetest.add_node(pos, {name="fire:basic_flame"})
  1741. end
  1742. end,
  1743. })
  1744. minetest.register_node("default:river_water_source", {
  1745. description = "Salt Water Source",
  1746. drawtype = "liquid",
  1747. tiles = {
  1748. {
  1749. name = "default_river_water_source_animated.png",
  1750. animation = {
  1751. type = "vertical_frames",
  1752. aspect_w = 16,
  1753. aspect_h = 16,
  1754. length = 2.0,
  1755. },
  1756. },
  1757. },
  1758. special_tiles = {
  1759. {
  1760. name = "default_river_water_source_animated.png",
  1761. animation = {
  1762. type = "vertical_frames",
  1763. aspect_w = 16,
  1764. aspect_h = 16,
  1765. length = 2.0,
  1766. },
  1767. backface_culling = false,
  1768. },
  1769. },
  1770. alpha = 160,
  1771. paramtype = "light",
  1772. walkable = false,
  1773. pointable = false,
  1774. diggable = false,
  1775. buildable_to = true,
  1776. is_ground_content = false,
  1777. drop = "",
  1778. drowning = 4,
  1779. liquidtype = "source",
  1780. liquid_alternative_flowing = "default:river_water_flowing",
  1781. liquid_alternative_source = "default:river_water_source",
  1782. liquid_viscosity = 1,
  1783. -- River water can be placed above ground, so liquid must NOT be renewable!
  1784. liquid_renewable = false,
  1785. liquid_range = 2,
  1786. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  1787. groups = {water = 3, liquid = 3, puts_out_fire = 1},
  1788. sounds = default.node_sound_water_defaults(),
  1789. -- Water turns to fire in the nether.
  1790. -- Note: this is not called if water-source is created by the engine due to liquid-flow mechanic.
  1791. on_construct = function(pos)
  1792. farming.notify_soil(pos)
  1793. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1794. minetest.add_node(pos, {name="fire:basic_flame"})
  1795. return
  1796. end
  1797. if pos.y < -25000 then
  1798. minetest.add_node(pos, {name="fire:basic_flame"})
  1799. end
  1800. end,
  1801. on_destruct = function(pos)
  1802. farming.notify_soil(pos)
  1803. end,
  1804. on_collapse_to_entity = function(pos, node)
  1805. -- Do not allow player to obtain the node itself.
  1806. end,
  1807. })
  1808. minetest.register_node("default:river_water_flowing", {
  1809. description = "Flowing Salt Water",
  1810. drawtype = "flowingliquid",
  1811. tiles = {"default_river_water.png"},
  1812. special_tiles = {
  1813. {
  1814. name = "default_river_water_flowing_animated.png",
  1815. backface_culling = false,
  1816. animation = {
  1817. type = "vertical_frames",
  1818. aspect_w = 16,
  1819. aspect_h = 16,
  1820. length = 0.8,
  1821. },
  1822. },
  1823. {
  1824. name = "default_river_water_flowing_animated.png",
  1825. backface_culling = true,
  1826. animation = {
  1827. type = "vertical_frames",
  1828. aspect_w = 16,
  1829. aspect_h = 16,
  1830. length = 0.8,
  1831. },
  1832. },
  1833. },
  1834. alpha = 160,
  1835. paramtype = "light",
  1836. paramtype2 = "flowingliquid",
  1837. walkable = false,
  1838. pointable = false,
  1839. diggable = false,
  1840. buildable_to = true,
  1841. is_ground_content = false,
  1842. drop = "",
  1843. drowning = 4,
  1844. liquidtype = "flowing",
  1845. liquid_alternative_flowing = "default:river_water_flowing",
  1846. liquid_alternative_source = "default:river_water_source",
  1847. liquid_viscosity = 1,
  1848. -- River water can be placed above ground, so liquid must NOT be renewable!
  1849. liquid_renewable = false,
  1850. liquid_range = 2,
  1851. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  1852. groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
  1853. sounds = default.node_sound_water_defaults(),
  1854. on_collapse_to_entity = function(pos, node)
  1855. -- Do not allow player to obtain the node itself.
  1856. end,
  1857. on_construct = function(pos)
  1858. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1859. minetest.set_node(pos, {name="fire:basic_flame"})
  1860. return
  1861. end
  1862. if pos.y < -25000 then
  1863. minetest.set_node(pos, {name="fire:basic_flame"})
  1864. end
  1865. end,
  1866. })
  1867. --
  1868. -- Tools / "Advanced" crafting / Non-"natural"
  1869. --
  1870. minetest.register_node("default:ladder_wood", {
  1871. description = "Wooden Ladder",
  1872. drawtype = "signlike",
  1873. tiles = {"default_ladder_wood.png"},
  1874. inventory_image = "default_ladder_wood.png",
  1875. wield_image = "default_ladder_wood.png",
  1876. paramtype = "light",
  1877. paramtype2 = "wallmounted",
  1878. sunlight_propagates = true,
  1879. walkable = false,
  1880. climbable = true,
  1881. is_ground_content = false,
  1882. selection_box = {
  1883. type = "wallmounted",
  1884. --wall_top = = <default>
  1885. --wall_bottom = = <default>
  1886. --wall_side = = <default>
  1887. },
  1888. groups = utility.dig_groups("bigitem", {flammable = 2, ladder=1}),
  1889. legacy_wallmounted = true,
  1890. sounds = default.node_sound_wood_defaults(),
  1891. -- Lava burns wood ladders instantly.
  1892. -- Water rots wood (instantly too, I guess).
  1893. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1894. floodable = true,
  1895. })
  1896. minetest.register_node("default:ladder_steel", {
  1897. description = "Wrought Iron Ladder",
  1898. drawtype = "signlike",
  1899. tiles = {"default_ladder_steel.png"},
  1900. inventory_image = "default_ladder_steel.png",
  1901. wield_image = "default_ladder_steel.png",
  1902. paramtype = "light",
  1903. paramtype2 = "wallmounted",
  1904. sunlight_propagates = true,
  1905. walkable = false,
  1906. climbable = true,
  1907. is_ground_content = false,
  1908. selection_box = {
  1909. type = "wallmounted",
  1910. --wall_top = = <default>
  1911. --wall_bottom = = <default>
  1912. --wall_side = = <default>
  1913. },
  1914. groups = utility.dig_groups("bigitem", {ladder=1}),
  1915. sounds = default.node_sound_metal_defaults(),
  1916. -- Lava melts metal ladders quickly.
  1917. -- Water rusts them (quickly too, I guess).
  1918. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1919. floodable = true,
  1920. })
  1921. minetest.register_node(":defauIt:ladder_wood", {
  1922. description = "Wooden Trap Ladder",
  1923. drawtype = "signlike",
  1924. tiles = {"default_ladder_wood.png"},
  1925. inventory_image = "default_ladder_wood.png",
  1926. wield_image = "default_ladder_wood.png",
  1927. paramtype = "light",
  1928. paramtype2 = "wallmounted",
  1929. sunlight_propagates = true,
  1930. walkable = false,
  1931. climbable = false, -- Player drops through.
  1932. is_ground_content = false,
  1933. selection_box = {
  1934. type = "wallmounted",
  1935. --wall_top = = <default>
  1936. --wall_bottom = = <default>
  1937. --wall_side = = <default>
  1938. },
  1939. groups = utility.dig_groups("bigitem", {flammable = 2}),
  1940. sounds = default.node_sound_wood_defaults(),
  1941. -- Lava burns wood ladders instantly.
  1942. -- Water rots wood (instantly too, I guess).
  1943. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1944. floodable = true,
  1945. })
  1946. minetest.register_node(":defauIt:ladder_steel", {
  1947. description = "Wrought Iron Trap Ladder",
  1948. drawtype = "signlike",
  1949. tiles = {"default_ladder_steel.png"},
  1950. inventory_image = "default_ladder_steel.png",
  1951. wield_image = "default_ladder_steel.png",
  1952. paramtype = "light",
  1953. paramtype2 = "wallmounted",
  1954. sunlight_propagates = true,
  1955. walkable = false,
  1956. climbable = false, -- Player drops through.
  1957. is_ground_content = false,
  1958. selection_box = {
  1959. type = "wallmounted",
  1960. --wall_top = = <default>
  1961. --wall_bottom = = <default>
  1962. --wall_side = = <default>
  1963. },
  1964. groups = utility.dig_groups("bigitem"),
  1965. sounds = default.node_sound_metal_defaults(),
  1966. -- Lava melts metal ladders quickly.
  1967. -- Water rusts them (quickly too, I guess).
  1968. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1969. floodable = true,
  1970. })
  1971. default.register_fence("default:fence_iron", {
  1972. description = "Wrought Iron Fence",
  1973. texture = "default_fence_iron.png",
  1974. inventory_image = "default_fence_overlay.png^default_fence_iron.png^default_fence_overlay.png^[makealpha:255,126,126",
  1975. wield_image = "default_fence_overlay.png^default_fence_iron.png^default_fence_overlay.png^[makealpha:255,126,126",
  1976. material = "default:steel_ingot",
  1977. groups = utility.dig_groups("fence_metal", {fence = 1}),
  1978. sounds = default.node_sound_metal_defaults()
  1979. })
  1980. default.register_fence("default:fence_bronze", {
  1981. description = "Bronze Fence",
  1982. texture = "default_fence_bronze.png",
  1983. inventory_image = "default_fence_overlay.png^default_fence_bronze.png^default_fence_overlay.png^[makealpha:255,126,126",
  1984. wield_image = "default_fence_overlay.png^default_fence_bronze.png^default_fence_overlay.png^[makealpha:255,126,126",
  1985. material = "default:bronze_ingot",
  1986. groups = utility.dig_groups("fence_metal", {fence = 1}),
  1987. sounds = default.node_sound_metal_defaults()
  1988. })
  1989. default.register_fence("default:fence_wood", {
  1990. description = "Wooden Fence",
  1991. texture = "default_fence_wood.png",
  1992. inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  1993. wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  1994. material = "default:wood",
  1995. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  1996. sounds = default.node_sound_wood_defaults()
  1997. })
  1998. default.register_fence("default:fence_acacia_wood", {
  1999. description = "Acacia Wood Fence",
  2000. texture = "default_fence_acacia_wood.png",
  2001. inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2002. wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2003. material = "default:acacia_wood",
  2004. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2005. sounds = default.node_sound_wood_defaults()
  2006. })
  2007. default.register_fence("default:fence_junglewood", {
  2008. description = "Jungle Wood Fence",
  2009. texture = "default_fence_junglewood.png",
  2010. inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2011. wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2012. material = "default:junglewood",
  2013. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2014. sounds = default.node_sound_wood_defaults()
  2015. })
  2016. default.register_fence("default:fence_pine_wood", {
  2017. description = "Pine Wood Fence",
  2018. texture = "default_fence_pine_wood.png",
  2019. inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2020. wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2021. material = "default:pine_wood",
  2022. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2023. sounds = default.node_sound_wood_defaults()
  2024. })
  2025. default.register_fence("default:fence_aspen_wood", {
  2026. description = "Aspen Wood Fence",
  2027. texture = "default_fence_aspen_wood.png",
  2028. inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2029. wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2030. material = "default:aspen_wood",
  2031. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2032. sounds = default.node_sound_wood_defaults()
  2033. })
  2034. minetest.register_node("default:glass", {
  2035. description = "Glass",
  2036. drawtype = "glasslike_framed_optional",
  2037. tiles = {"default_glass.png", "default_glass_detail.png"},
  2038. paramtype = "light",
  2039. sunlight_propagates = true,
  2040. is_ground_content = false,
  2041. groups = utility.dig_groups("glass", {glass=1}),
  2042. sounds = default.node_sound_glass_defaults(),
  2043. drop = "vessels:glass_fragments",
  2044. silverpick_drop = true,
  2045. })
  2046. minetest.register_node("default:obsidian_glass", {
  2047. description = "Obsidian Glass",
  2048. drawtype = "glasslike_framed_optional",
  2049. tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
  2050. paramtype = "light",
  2051. is_ground_content = false,
  2052. sunlight_propagates = true,
  2053. sounds = default.node_sound_glass_defaults(),
  2054. groups = utility.dig_groups("glass", {glass=1}),
  2055. drop = "default:obsidian_shard",
  2056. silverpick_drop = true,
  2057. })
  2058. minetest.register_node("default:brick", {
  2059. description = "Brick Block",
  2060. paramtype2 = "facedir",
  2061. place_param2 = 0,
  2062. tiles = {"default_brick.png"},
  2063. is_ground_content = false,
  2064. groups = utility.dig_groups("brick", {brick = 1}),
  2065. sounds = default.node_sound_stone_defaults(),
  2066. })
  2067. minetest.register_node("default:meselamp", {
  2068. description = "Mese Lamp",
  2069. drawtype = "glasslike",
  2070. tiles = {"default_meselamp.png"},
  2071. paramtype = "light",
  2072. sunlight_propagates = true,
  2073. is_ground_content = false,
  2074. groups = utility.dig_groups("glass"),
  2075. sounds = default.node_sound_glass_defaults(),
  2076. light_source = default.LIGHT_MAX-1,
  2077. })
  2078. minetest.register_node("default:lightbox", {
  2079. description = "Light Box",
  2080. drawtype = "glasslike",
  2081. tiles = {"default_lightbox.png"},
  2082. paramtype = "light",
  2083. sunlight_propagates = true,
  2084. is_ground_content = false,
  2085. groups = utility.dig_groups("glass"),
  2086. sounds = default.node_sound_glass_defaults(),
  2087. light_source = default.LIGHT_MAX - 2,
  2088. })