nodes.lua 72 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388
  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 = {"default_stone.png"},
  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 = {"default_desert_stone.png"},
  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. -- Digging coal ore has a chance to release poison gas.
  870. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  871. if pos.y < -1024 then
  872. if math_random(1, 300) == 1 then
  873. breath.spawn_gas(pos)
  874. end
  875. end
  876. end,
  877. })
  878. minetest.register_node("default:desert_stone_with_coal", {
  879. description = "Redstone Coal Deposit",
  880. tiles = {"default_desert_stone.png^default_mineral_coal2.png"},
  881. -- Cannot be flammable (although I would like it to be)
  882. -- because that interferes with TNT mining (the TNT replaces
  883. -- all coal with flame instead of dropping it).
  884. groups = utility.dig_groups("mineral"),
  885. drop = 'default:coal_lump',
  886. silverpick_drop = true,
  887. sounds = default.node_sound_stone_defaults(),
  888. })
  889. minetest.register_node("default:coalblock", {
  890. description = "Coal Block",
  891. tiles = {"default_coal_block.png"},
  892. is_ground_content = false,
  893. groups = utility.dig_groups("cobble", {flammable = 3}),
  894. sounds = default.node_sound_stone_defaults(),
  895. })
  896. minetest.register_node("default:stone_with_iron", {
  897. description = "Iron Ore",
  898. tiles = {"default_stone.png^default_mineral_iron.png"},
  899. groups = utility.dig_groups("mineral", {ore = 1}),
  900. drop = 'default:iron_lump',
  901. silverpick_drop = true,
  902. sounds = default.node_sound_stone_defaults(),
  903. })
  904. minetest.register_node("default:steelblock", {
  905. description = "Wrought Iron Block",
  906. tiles = {"default_steel_block.png"},
  907. is_ground_content = false,
  908. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  909. sounds = default.node_sound_metal_defaults(),
  910. })
  911. minetest.register_node("default:stone_with_copper", {
  912. description = "Copper Ore",
  913. tiles = {"default_stone.png^default_mineral_copper.png"},
  914. groups = utility.dig_groups("mineral", {ore = 1}),
  915. drop = 'default:copper_lump',
  916. silverpick_drop = true,
  917. sounds = default.node_sound_stone_defaults(),
  918. })
  919. minetest.register_node("default:desert_stone_with_copper", {
  920. description = "Redstone Copper Ore",
  921. -- Use old copper image, the pattern looks nicer.
  922. tiles = {"default_desert_stone.png^default_mineral_copper2.png"},
  923. groups = utility.dig_groups("mineral", {ore = 1}),
  924. drop = 'default:copper_lump',
  925. silverpick_drop = true,
  926. sounds = default.node_sound_stone_defaults(),
  927. })
  928. minetest.register_node("default:desert_stone_with_iron", {
  929. description = "Redstone Iron Ore",
  930. -- Use old iron image, the pattern looks nicer.
  931. tiles = {"default_desert_stone.png^default_mineral_iron2.png"},
  932. groups = utility.dig_groups("mineral", {ore = 1}),
  933. drop = 'default:iron_lump',
  934. silverpick_drop = true,
  935. sounds = default.node_sound_stone_defaults(),
  936. })
  937. minetest.register_node("default:desert_stone_with_diamond", {
  938. description = "Redstone Diamond Deposit",
  939. -- Use old diamond image, the pattern looks nicer.
  940. tiles = {"default_desert_stone.png^default_mineral_diamond2.png"},
  941. groups = utility.dig_groups("hardmineral"),
  942. drop = 'default:diamond',
  943. silverpick_drop = true,
  944. sounds = default.node_sound_stone_defaults(),
  945. })
  946. minetest.register_node("default:copperblock", {
  947. description = "Copper Block",
  948. tiles = {"default_copper_block.png"},
  949. is_ground_content = false,
  950. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  951. sounds = default.node_sound_metal_defaults(),
  952. })
  953. minetest.register_node("default:bronzeblock", {
  954. description = "Bronze Block",
  955. tiles = {"default_bronze_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:stone_with_mese", {
  961. description = "Mese Ore",
  962. tiles = {"default_stone.png^default_mineral_mese.png"},
  963. groups = utility.dig_groups("hardmineral", {melts = 1}),
  964. drop = "default:mese_crystal",
  965. silverpick_drop = true,
  966. sounds = default.node_sound_stone_defaults(),
  967. -- Mese in stone reacts badly to lava.
  968. on_melt = function(pos, other)
  969. minetest.after(0, function()
  970. tnt.boom(pos, {
  971. radius = 4,
  972. ignore_protection = false,
  973. ignore_on_blast = false,
  974. damage_radius = 6,
  975. disable_drops = true,
  976. })
  977. end)
  978. end,
  979. })
  980. minetest.register_node("default:mese", {
  981. description = "Mese Block",
  982. tiles = {"default_mese_block.png"},
  983. paramtype = "light",
  984. groups = utility.dig_groups("hardstone", {melts = 1}),
  985. sounds = default.node_sound_stone_defaults(),
  986. light_source = 3,
  987. -- Mese in stone reacts badly to lava.
  988. -- Meseblock makes a much larger blast.
  989. on_melt = function(pos, other)
  990. minetest.after(0, function()
  991. tnt.boom(pos, {
  992. radius = 10,
  993. ignore_protection = false,
  994. ignore_on_blast = false,
  995. damage_radius = 20,
  996. disable_drops = true,
  997. })
  998. end)
  999. end,
  1000. })
  1001. minetest.register_node("default:stone_with_gold", {
  1002. description = "Gold Ore",
  1003. tiles = {"default_stone.png^default_mineral_gold.png"},
  1004. groups = utility.dig_groups("mineral", {ore = 1}),
  1005. drop = "default:gold_lump",
  1006. silverpick_drop = true,
  1007. sounds = default.node_sound_stone_defaults(),
  1008. })
  1009. minetest.register_node("default:goldblock", {
  1010. description = "Gold Block",
  1011. tiles = {"default_gold_block.png"},
  1012. is_ground_content = false,
  1013. groups = utility.dig_groups("block", {conductor = 1, block = 1}),
  1014. sounds = default.node_sound_metal_defaults(),
  1015. })
  1016. minetest.register_node("default:stone_with_diamond", {
  1017. description = "Diamond Deposit",
  1018. tiles = {"default_stone.png^default_mineral_diamond.png"},
  1019. -- Player has to get mese pick or similar before they can get diamond.
  1020. groups = utility.dig_groups("hardmineral"),
  1021. drop = "default:diamond",
  1022. silverpick_drop = true,
  1023. sounds = default.node_sound_stone_defaults(),
  1024. })
  1025. minetest.register_node("default:diamondblock", {
  1026. description = "Diamond Block",
  1027. tiles = {"default_diamond_block.png"},
  1028. is_ground_content = false,
  1029. groups = utility.dig_groups("obsidian"),
  1030. sounds = default.node_sound_stone_defaults(),
  1031. })
  1032. --
  1033. -- Plantlife (non-cubic)
  1034. --
  1035. do
  1036. local nodebox = {
  1037. -- Spine strips.
  1038. {0, 1, 1, 16, 15, 1},
  1039. {0, 1, 15, 16, 15, 15},
  1040. {1, 1, 0, 1, 15, 16},
  1041. {15, 1, 0, 15, 15, 16},
  1042. -- Meat.
  1043. {1, 0, 1, 15, 16, 15},
  1044. -- Side skin.
  1045. {4, 0, 0, 12, 16, 16},
  1046. {0, 0, 4, 16, 16, 12},
  1047. }
  1048. local selectionbox = {
  1049. {1, 0, 1, 15, 16, 15},
  1050. }
  1051. utility.transform_nodebox(nodebox)
  1052. utility.transform_nodebox(selectionbox)
  1053. minetest.register_node("default:cactus", {
  1054. description = "Cactus",
  1055. tiles = {
  1056. "default_cactus_top.png",
  1057. "default_cactus_top.png",
  1058. "default_cactus_side.png"
  1059. },
  1060. paramtype = "light",
  1061. drawtype = "nodebox",
  1062. node_box = {
  1063. type = "fixed",
  1064. fixed = nodebox,
  1065. },
  1066. selection_box = {
  1067. type = "fixed",
  1068. fixed = selectionbox,
  1069. },
  1070. paramtype2 = "facedir",
  1071. groups = utility.dig_groups("softwood", {flammable = 1, fall_damage_add_percent = 100}),
  1072. sounds = default.node_sound_wood_defaults(),
  1073. on_place = minetest.rotate_node,
  1074. damage_per_second = 1,
  1075. on_punch = function(pos, node, puncher, pt)
  1076. if not puncher or not puncher:is_player() then return end
  1077. local stack = puncher:get_wielded_item()
  1078. local name = stack:get_name() or ""
  1079. if not string.find(name, "axe") then
  1080. puncher:set_hp(puncher:get_hp() - 1)
  1081. end
  1082. end,
  1083. on_player_walk_over = function(pos, player)
  1084. player:set_hp(player:get_hp() - 1)
  1085. if player:get_hp() == 0 then
  1086. minetest.chat_send_all("# Server: <" .. rename.gpn(player:get_player_name()) .. "> stepped on cactus. Noob!")
  1087. end
  1088. end,
  1089. on_construct = function(...)
  1090. return cactus.on_construct(...)
  1091. end,
  1092. on_destruct = function(...)
  1093. return cactus.on_destruct(...)
  1094. end,
  1095. on_timer = function(...)
  1096. return cactus.on_timer(...)
  1097. end,
  1098. after_dig_node = function(...)
  1099. return cactus.after_dig_node(...)
  1100. end,
  1101. })
  1102. end
  1103. --[[
  1104. --= Tests of Tools Against Default Groups =--
  1105. result_of {snappy = 1, choppy = 3} + tool=default:axe_stone : digsound=success
  1106. result_of {snappy = 1, choppy = 3} + tool=default:axe_diamond : digsound=success
  1107. result_of {snappy = 1, choppy = 3} + tool=default:axe_steel : digsound=success
  1108. result_of {snappy = 1, choppy = 3} + tool=default:axe_mese : digsound=success
  1109. result_of {snappy = 1, choppy = 3} + tool=default:sword_steel : digsound=failure
  1110. result_of {snappy = 1, choppy = 3} + tool=default:sword_stone : digsound=N/A (could not dig)
  1111. result_of {snappy = 1, choppy = 3} + tool=default:sword_diamond : digsound=failure
  1112. result_of {snappy = 1, choppy = 3} + tool=default:sword_mese : digsound=failure
  1113. result_of {snappy = 1, choppy = 3} + tool=default:shovel_stone : digsound=N/A (could not dig)
  1114. result_of {snappy = 1, choppy = 3} + tool=default:shovel_steel : digsound=N/A (could not dig)
  1115. result_of {snappy = 1, choppy = 3} + tool=default:shovel_diamond : digsound=N/A (could not dig)
  1116. result_of {snappy = 1, choppy = 3} + tool=default:shovel_mese : digsound=N/A (could not dig)
  1117. result_of {snappy = 1, choppy = 3} + tool=default:pick_stone : digsound=N/A (could not dig)
  1118. result_of {snappy = 1, choppy = 3} + tool=default:pick_steel : digsound=N/A (could not dig)
  1119. result_of {snappy = 1, choppy = 3} + tool=default:pick_diamond : digsound=N/A (could not dig)
  1120. result_of {snappy = 1, choppy = 3} + tool=default:pick_mese : digsound=N/A (could not dig)
  1121. --= Tests of Tools Against Modified Groups (A) =--
  1122. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_stone : digsound=N/A (could not dig)
  1123. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_steel : digsound=success
  1124. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_diamond : digsound=success
  1125. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:pick_mese : digsound=success
  1126. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_stone : digsound=success
  1127. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_steel : digsound=success
  1128. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_diamond : digsound=success
  1129. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:axe_mese : digsound=success
  1130. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_stone : digsound=N/A (could not dig)
  1131. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_steel : digsound=N/A (could not dig)
  1132. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_diamond : digsound=N/A (could not dig)
  1133. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:shovel_mese : digsound=N/A (could not dig)
  1134. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1135. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_steel : digsound=failure
  1136. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_diamond : digsound=failure
  1137. result_of {snappy = 1, choppy = 3, cracky = 1} + tool=default:sword_mese : digsound=failure
  1138. --= Tests of Tools Against Modified Groups (B) =--
  1139. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_stone : digsound=N/A (could not dig)
  1140. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_steel : digsound=success
  1141. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_diamond : digsound=success
  1142. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:pick_mese : digsound=success
  1143. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_stone : digsound=success
  1144. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_steel : digsound=success
  1145. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_diamond : digsound=success
  1146. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:axe_mese : digsound=success
  1147. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_stone : digsound=success
  1148. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_steel : digsound=success
  1149. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_diamond : digsound=success
  1150. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:shovel_mese : digsound=success
  1151. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1152. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_steel : digsound=failure
  1153. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_diamond : digsound=failure
  1154. result_of {snappy = 1, choppy = 3, cracky = 1, crumbly = 1} + tool=default:sword_mese : digsound=failure
  1155. --= Tests of Swords Against Modified Groups (C) =--
  1156. result_of {snappy = 1} + tool=default:sword_stone : digsound=N/A (could not dig)
  1157. result_of {snappy = 1} + tool=default:sword_steel : digsound=failure
  1158. result_of {snappy = 1} + tool=default:sword_diamond : digsound=failure
  1159. result_of {snappy = 1} + tool=default:sword_mese : digsound=failure
  1160. --]]
  1161. minetest.register_node("default:papyrus", {
  1162. description = "Papyrus",
  1163. drawtype = "plantlike",
  1164. tiles = {"default_papyrus.png"},
  1165. inventory_image = "default_papyrus.png",
  1166. wield_image = "default_papyrus.png",
  1167. paramtype = "light",
  1168. sunlight_propagates = true,
  1169. walkable = false,
  1170. selection_box = {
  1171. type = "fixed",
  1172. fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
  1173. },
  1174. groups = utility.dig_groups("plant", {flammable = 2}),
  1175. sounds = default.node_sound_leaves_defaults(),
  1176. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1177. on_construct = function(...)
  1178. return papyrus.on_construct(...)
  1179. end,
  1180. on_destruct = function(...)
  1181. return papyrus.on_destruct(...)
  1182. end,
  1183. on_timer = function(...)
  1184. return papyrus.on_timer(...)
  1185. end,
  1186. after_dig_node = function(...)
  1187. return papyrus.after_dig_node(...)
  1188. end,
  1189. })
  1190. minetest.register_node("default:dry_shrub", {
  1191. description = "Dry Shrub",
  1192. drawtype = "plantlike",
  1193. waving = 1,
  1194. --visual_scale = 1.0,
  1195. tiles = {"default_dry_shrub.png"},
  1196. inventory_image = "default_dry_shrub.png",
  1197. wield_image = "default_dry_shrub.png",
  1198. paramtype = "light",
  1199. sunlight_propagates = true,
  1200. walkable = false,
  1201. buildable_to = true,
  1202. groups = utility.dig_groups("plant", {flammable = 3, attached_node = 1, dry_grass = 1}),
  1203. sounds = default.node_sound_leaves_defaults(),
  1204. selection_box = {
  1205. type = "fixed",
  1206. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1207. },
  1208. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1209. -- Drop 1 or 2 sticks.
  1210. drop = {
  1211. max_items = 1,
  1212. items = {
  1213. {items = {'default:stick 2'}, rarity = 2},
  1214. {items = {'default:stick'}},
  1215. }
  1216. },
  1217. shears_drop = true,
  1218. flowerpot_drop = "default:dry_shrub",
  1219. })
  1220. minetest.register_node("default:junglegrass", {
  1221. description = "Jungle Grass",
  1222. drawtype = "plantlike",
  1223. waving = 1,
  1224. visual_scale = 1.69,
  1225. tiles = {"default_junglegrass.png"},
  1226. inventory_image = "default_junglegrass.png",
  1227. wield_image = "default_junglegrass.png",
  1228. paramtype = "light",
  1229. paramtype2 = "meshoptions",
  1230. place_param2 = 2,
  1231. sunlight_propagates = true,
  1232. walkable = false,
  1233. buildable_to = true,
  1234. -- Default drops are defined in farming mod.
  1235. flowerpot_drop = "default:junglegrass",
  1236. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1}),
  1237. sounds = default.node_sound_leaves_defaults(),
  1238. selection_box = {
  1239. type = "fixed",
  1240. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1241. },
  1242. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1243. on_construct = function(...)
  1244. return flowers.on_flora_construct(...)
  1245. end,
  1246. on_destruct = function(...)
  1247. return flowers.on_flora_destruct(...)
  1248. end,
  1249. on_timer = function(...)
  1250. return flowers.on_flora_timer(...)
  1251. end,
  1252. on_punch = function(...)
  1253. return flowers.on_flora_punch(...)
  1254. end,
  1255. })
  1256. minetest.register_node("default:coarsegrass", {
  1257. description = "Coarse Grass",
  1258. drawtype = "plantlike",
  1259. waving = 1,
  1260. visual_scale = 1.0,
  1261. tiles = {"default_junglegrass_newstyle.png"},
  1262. inventory_image = "default_junglegrass_newstyle.png",
  1263. wield_image = "default_junglegrass_newstyle.png",
  1264. paramtype = "light",
  1265. paramtype2 = "meshoptions",
  1266. place_param2 = 2,
  1267. sunlight_propagates = true,
  1268. walkable = false,
  1269. buildable_to = true,
  1270. drop = "default:stick",
  1271. shears_drop = true,
  1272. flowerpot_drop = "default:coarsegrass",
  1273. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, grass = 1, junglegrass = 1, flammable = 1}),
  1274. sounds = default.node_sound_leaves_defaults(),
  1275. selection_box = {
  1276. type = "fixed",
  1277. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1278. },
  1279. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1280. on_construct = function(...)
  1281. return flowers.on_flora_construct(...)
  1282. end,
  1283. on_destruct = function(...)
  1284. return flowers.on_flora_destruct(...)
  1285. end,
  1286. on_timer = function(...)
  1287. return flowers.on_flora_timer(...)
  1288. end,
  1289. on_punch = function(...)
  1290. return flowers.on_flora_punch(...)
  1291. end,
  1292. })
  1293. -- This node is not meant to be placed in the world.
  1294. -- Instead, placing it causes 1 of several other nodetypes to be placed instead.
  1295. minetest.register_node("default:grass_dummy", {
  1296. description = "Wild Grass\n\nA common field plant, sometimes containing seeds.\nCan be hung upside down like some herbs.",
  1297. drawtype = "plantlike",
  1298. waving = 1,
  1299. tiles = {"default_grass_1.png"},
  1300. -- Use texture of a taller grass stage in inventory
  1301. inventory_image = "default_grass_3.png",
  1302. wield_image = "default_grass_3.png",
  1303. paramtype = "light",
  1304. paramtype2 = "meshoptions",
  1305. place_param2 = 2,
  1306. sounds = default.node_sound_leaves_defaults(),
  1307. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1308. flowerpot_insert = {"default:grass_1", "default:grass_2", "default:grass_3", "default:grass_4", "default:grass_5"},
  1309. -- Zero-width selection box.
  1310. selection_box = {
  1311. type = "fixed",
  1312. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1313. },
  1314. on_place = function(itemstack, placer, pt)
  1315. -- place a random grass node
  1316. -- If pointing to the ceiling place hanging grass.
  1317. --minetest.chat_send_all(dump(pt))
  1318. if pt.type == "node" then
  1319. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1320. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1321. if pt.under.y-1 == pt.above.y then
  1322. --minetest.chat_send_all("hanging!")
  1323. local stack = ItemStack("default:grass_" .. math_random(1,5) .. "_hanging")
  1324. local ret = minetest.item_place(stack, placer, pt)
  1325. return ItemStack("default:grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1326. end
  1327. end
  1328. local stack = ItemStack("default:grass_" .. math_random(1,5))
  1329. local ret = minetest.item_place(stack, placer, pt)
  1330. return ItemStack("default:grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1331. end,
  1332. })
  1333. for i = 1, 5 do
  1334. minetest.register_node("default:grass_" .. i, {
  1335. description = "Grass",
  1336. drawtype = "plantlike",
  1337. waving = 1,
  1338. tiles = {"default_grass_" .. i .. ".png"},
  1339. inventory_image = "default_grass_3.png",
  1340. wield_image = "default_grass_3.png",
  1341. paramtype = "light",
  1342. paramtype2 = "meshoptions",
  1343. place_param2 = 2,
  1344. sunlight_propagates = true,
  1345. walkable = false,
  1346. buildable_to = true,
  1347. -- Default drops are defined in farming mod.
  1348. flowerpot_drop = "default:grass_dummy",
  1349. groups = utility.dig_groups("plant", {flora = 1, attached_node = 1, not_in_creative_inventory = 1, grass = 1, flammable = 1}),
  1350. sounds = default.node_sound_leaves_defaults(),
  1351. selection_box = {
  1352. type = "fixed",
  1353. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1354. },
  1355. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1356. on_construct = function(...)
  1357. return flowers.on_flora_construct(...)
  1358. end,
  1359. on_destruct = function(...)
  1360. return flowers.on_flora_destruct(...)
  1361. end,
  1362. on_timer = function(...)
  1363. return flowers.on_flora_timer(...)
  1364. end,
  1365. on_punch = function(...)
  1366. return flowers.on_flora_punch(...)
  1367. end,
  1368. })
  1369. end
  1370. for i = 1, 5 do
  1371. minetest.register_node("default:grass_" .. i .. "_hanging", {
  1372. description = "Hanging Grass",
  1373. drawtype = "plantlike",
  1374. -- Waving hanging nodes look ugly.
  1375. --waving = 1,
  1376. tiles = {"default_grass_" .. i .. ".png^[transformFY"},
  1377. inventory_image = "default_grass_3.png",
  1378. wield_image = "default_grass_3.png",
  1379. paramtype = "light",
  1380. paramtype2 = "meshoptions",
  1381. place_param2 = 2,
  1382. sunlight_propagates = true,
  1383. walkable = false,
  1384. buildable_to = true,
  1385. -- Default drops are defined in farming mod.
  1386. flowerpot_drop = "default:grass_dummy",
  1387. groups = utility.dig_groups("plant", {hanging_node = 1, not_in_creative_inventory = 1, grass = 1, flammable = 1}),
  1388. sounds = default.node_sound_leaves_defaults(),
  1389. selection_box = {
  1390. type = "fixed",
  1391. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1392. },
  1393. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1394. })
  1395. end
  1396. minetest.register_node("default:dry_grass_dummy", {
  1397. description = "Dry Grass",
  1398. drawtype = "plantlike",
  1399. waving = 1,
  1400. tiles = {"default_dry_grass_1.png"},
  1401. inventory_image = "default_dry_grass_3.png",
  1402. wield_image = "default_dry_grass_3.png",
  1403. paramtype = "light",
  1404. paramtype2 = "meshoptions",
  1405. place_param2 = 2,
  1406. sounds = default.node_sound_leaves_defaults(),
  1407. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1408. flowerpot_insert = {"default:dry_grass_1", "default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4", "default:dry_grass_5"},
  1409. -- Zero-width selection box.
  1410. selection_box = {
  1411. type = "fixed",
  1412. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1413. },
  1414. on_place = function(itemstack, placer, pt)
  1415. -- place a random dry grass node
  1416. -- If pointing to the ceiling place hanging grass.
  1417. --minetest.chat_send_all(dump(pt))
  1418. if pt.type == "node" then
  1419. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1420. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1421. if pt.under.y-1 == pt.above.y then
  1422. --minetest.chat_send_all("hanging!")
  1423. local stack = ItemStack("default:dry_grass_" .. math_random(1,5) .. "_hanging")
  1424. local ret = minetest.item_place(stack, placer, pt)
  1425. return ItemStack("default:dry_grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1426. end
  1427. end
  1428. local stack = ItemStack("default:dry_grass_" .. math_random(1, 5))
  1429. local ret = minetest.item_place(stack, placer, pt)
  1430. return ItemStack("default:dry_grass_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1431. end,
  1432. })
  1433. for i = 1, 5 do
  1434. minetest.register_node("default:dry_grass_" .. i, {
  1435. description = "Dry Grass",
  1436. drawtype = "plantlike",
  1437. waving = 1,
  1438. tiles = {"default_dry_grass_" .. i .. ".png"},
  1439. inventory_image = "default_dry_grass_3.png",
  1440. wield_image = "default_dry_grass_3.png",
  1441. paramtype = "light",
  1442. paramtype2 = "meshoptions",
  1443. place_param2 = 2,
  1444. sunlight_propagates = true,
  1445. walkable = false,
  1446. buildable_to = true,
  1447. groups = utility.dig_groups("plant", {flammable = 3, flora = 1, attached_node = 1,
  1448. not_in_creative_inventory=1, dry_grass = 1}),
  1449. drop = "",
  1450. shears_drop = "default:dry_grass_dummy",
  1451. flowerpot_drop = "default:dry_grass_dummy",
  1452. sounds = default.node_sound_leaves_defaults(),
  1453. selection_box = {
  1454. type = "fixed",
  1455. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1456. },
  1457. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1458. on_construct = function(...)
  1459. return flowers.on_flora_construct(...)
  1460. end,
  1461. on_destruct = function(...)
  1462. return flowers.on_flora_destruct(...)
  1463. end,
  1464. on_timer = function(...)
  1465. return flowers.on_flora_timer(...)
  1466. end,
  1467. on_punch = function(...)
  1468. return flowers.on_flora_punch(...)
  1469. end,
  1470. })
  1471. end
  1472. for i = 1, 5 do
  1473. minetest.register_node("default:dry_grass_" .. i .. "_hanging", {
  1474. description = "Dry Grass",
  1475. drawtype = "plantlike",
  1476. -- Waving hanging grass looks silly.
  1477. --waving = 1,
  1478. tiles = {"default_dry_grass_" .. i .. ".png^[transformFY"},
  1479. inventory_image = "default_dry_grass_3.png",
  1480. wield_image = "default_dry_grass_3.png",
  1481. paramtype = "light",
  1482. paramtype2 = "meshoptions",
  1483. place_param2 = 2,
  1484. sunlight_propagates = true,
  1485. walkable = false,
  1486. buildable_to = true,
  1487. -- Not in flora group, since it does not need to spread.
  1488. groups = utility.dig_groups("plant", {flammable = 3, hanging_node = 1,
  1489. not_in_creative_inventory=1, dry_grass = 1}),
  1490. drop = "",
  1491. shears_drop = "default:dry_grass_dummy",
  1492. flowerpot_drop = "default:dry_grass_dummy",
  1493. sounds = default.node_sound_leaves_defaults(),
  1494. selection_box = {
  1495. type = "fixed",
  1496. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1497. },
  1498. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1499. })
  1500. end
  1501. minetest.register_node("default:dry_grass2_dummy", {
  1502. description = "Dry Grass",
  1503. drawtype = "plantlike",
  1504. waving = 1,
  1505. tiles = {"default_dry_grass2_1.png"},
  1506. inventory_image = "default_dry_grass2_3.png",
  1507. wield_image = "default_dry_grass2_3.png",
  1508. paramtype = "light",
  1509. paramtype2 = "meshoptions",
  1510. place_param2 = 2,
  1511. sounds = default.node_sound_leaves_defaults(),
  1512. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1513. flowerpot_insert = {"default:dry_grass2_1", "default:dry_grass2_2", "default:dry_grass2_3", "default:dry_grass2_4", "default:dry_grass2_5"},
  1514. -- Zero-width selection box.
  1515. selection_box = {
  1516. type = "fixed",
  1517. fixed = {-0.5, -0.5, -0.5, 0.5, -0.5, 0.5},
  1518. },
  1519. on_place = function(itemstack, placer, pt)
  1520. -- place a random dry grass node
  1521. -- If pointing to the ceiling place hanging grass.
  1522. --minetest.chat_send_all(dump(pt))
  1523. if pt.type == "node" then
  1524. --minetest.chat_send_all("1: " .. minetest.pos_to_string(pt.under) .. ".")
  1525. --minetest.chat_send_all("2: " .. minetest.pos_to_string(pt.above) .. ".")
  1526. if pt.under.y-1 == pt.above.y then
  1527. --minetest.chat_send_all("hanging!")
  1528. local stack = ItemStack("default:dry_grass2_" .. math_random(1,5) .. "_hanging")
  1529. local ret = minetest.item_place(stack, placer, pt)
  1530. return ItemStack("default:dry_grass2_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1531. end
  1532. end
  1533. local stack = ItemStack("default:dry_grass2_" .. math_random(1, 5))
  1534. local ret = minetest.item_place(stack, placer, pt)
  1535. return ItemStack("default:dry_grass2_dummy " .. itemstack:get_count() - (1 - ret:get_count()))
  1536. end,
  1537. })
  1538. for i = 1, 5 do
  1539. minetest.register_node("default:dry_grass2_" .. i, {
  1540. description = "Dry Grass",
  1541. drawtype = "plantlike",
  1542. waving = 1,
  1543. tiles = {"default_dry_grass2_" .. i .. ".png"},
  1544. inventory_image = "default_dry_grass2_3.png",
  1545. wield_image = "default_dry_grass2_3.png",
  1546. paramtype = "light",
  1547. paramtype2 = "meshoptions",
  1548. place_param2 = 2,
  1549. sunlight_propagates = true,
  1550. walkable = false,
  1551. buildable_to = true,
  1552. groups = utility.dig_groups("plant", {flammable = 3, flora = 1, attached_node = 1,
  1553. not_in_creative_inventory=1, dry_grass = 1}),
  1554. drop = "",
  1555. shears_drop = "default:dry_grass2_dummy",
  1556. flowerpot_drop = "default:dry_grass2_dummy",
  1557. sounds = default.node_sound_leaves_defaults(),
  1558. selection_box = {
  1559. type = "fixed",
  1560. fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
  1561. },
  1562. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1563. on_construct = function(...)
  1564. return flowers.on_flora_construct(...)
  1565. end,
  1566. on_destruct = function(...)
  1567. return flowers.on_flora_destruct(...)
  1568. end,
  1569. on_timer = function(...)
  1570. return flowers.on_flora_timer(...)
  1571. end,
  1572. on_punch = function(...)
  1573. return flowers.on_flora_punch(...)
  1574. end,
  1575. })
  1576. end
  1577. for i = 1, 5 do
  1578. minetest.register_node("default:dry_grass2_" .. i .. "_hanging", {
  1579. description = "Dry Grass",
  1580. drawtype = "plantlike",
  1581. -- Waving hanging grass looks silly.
  1582. --waving = 1,
  1583. tiles = {"default_dry_grass2_" .. i .. ".png^[transformFY"},
  1584. inventory_image = "default_dry_grass2_3.png",
  1585. wield_image = "default_dry_grass2_3.png",
  1586. paramtype = "light",
  1587. paramtype2 = "meshoptions",
  1588. place_param2 = 2,
  1589. sunlight_propagates = true,
  1590. walkable = false,
  1591. buildable_to = true,
  1592. -- Not in flora group, since it does not need to spread.
  1593. groups = utility.dig_groups("plant", {flammable = 3, hanging_node = 1,
  1594. not_in_creative_inventory=1, dry_grass = 1}),
  1595. drop = "",
  1596. shears_drop = "default:dry_grass2_dummy",
  1597. flowerpot_drop = "default:dry_grass2_dummy",
  1598. sounds = default.node_sound_leaves_defaults(),
  1599. selection_box = {
  1600. type = "fixed",
  1601. fixed = {-0.5, 0.5, -0.5, 0.5, 5/16, 0.5},
  1602. },
  1603. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  1604. })
  1605. end
  1606. --
  1607. -- Liquids
  1608. --
  1609. minetest.register_node("default:water_source", {
  1610. description = "Water Source",
  1611. drawtype = "liquid",
  1612. tiles = {
  1613. {
  1614. name = "default_water_source_animated.png",
  1615. animation = {
  1616. type = "vertical_frames",
  1617. aspect_w = 16,
  1618. aspect_h = 16,
  1619. length = 2.0,
  1620. },
  1621. },
  1622. },
  1623. special_tiles = {
  1624. -- New-style water source material (mostly unused)
  1625. {
  1626. name = "default_water_source_animated.png",
  1627. animation = {
  1628. type = "vertical_frames",
  1629. aspect_w = 16,
  1630. aspect_h = 16,
  1631. length = 2.0,
  1632. },
  1633. backface_culling = false,
  1634. },
  1635. },
  1636. alpha = 160,
  1637. paramtype = "light",
  1638. walkable = false,
  1639. pointable = false,
  1640. diggable = false,
  1641. buildable_to = true,
  1642. is_ground_content = false,
  1643. drop = "",
  1644. drowning = 4,
  1645. liquidtype = "source",
  1646. liquid_alternative_flowing = "default:water_flowing",
  1647. liquid_alternative_source = "default:water_source",
  1648. liquid_viscosity = 1,
  1649. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1650. groups = {water = 3, liquid = 3, puts_out_fire = 1},
  1651. sounds = default.node_sound_water_defaults(),
  1652. -- Water turns to fire in the nether.
  1653. -- Note: this is not called if water-source is created by the engine due to liquid-flow mechanic.
  1654. on_construct = function(pos)
  1655. farming.notify_soil(pos)
  1656. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1657. minetest.add_node(pos, {name="fire:basic_flame"})
  1658. return
  1659. end
  1660. if rc.current_realm_at_pos(pos) == "channelwood" then
  1661. minetest.swap_node(pos, {name="cw:water_source"})
  1662. return
  1663. end
  1664. if pos.y < -25000 then
  1665. minetest.add_node(pos, {name="fire:basic_flame"})
  1666. end
  1667. end,
  1668. on_destruct = function(pos)
  1669. farming.notify_soil(pos)
  1670. end,
  1671. on_collapse_to_entity = function(pos, node)
  1672. -- Do not allow player to obtain the node itself.
  1673. end,
  1674. })
  1675. minetest.register_node("default:water_flowing", {
  1676. description = "Flowing Water",
  1677. drawtype = "flowingliquid",
  1678. tiles = {"default_water.png"},
  1679. special_tiles = {
  1680. {
  1681. name = "default_water_flowing_animated.png",
  1682. backface_culling = false,
  1683. animation = {
  1684. type = "vertical_frames",
  1685. aspect_w = 16,
  1686. aspect_h = 16,
  1687. length = 0.8,
  1688. },
  1689. },
  1690. {
  1691. name = "default_water_flowing_animated.png",
  1692. backface_culling = true,
  1693. animation = {
  1694. type = "vertical_frames",
  1695. aspect_w = 16,
  1696. aspect_h = 16,
  1697. length = 0.8,
  1698. },
  1699. },
  1700. },
  1701. alpha = 160,
  1702. paramtype = "light",
  1703. paramtype2 = "flowingliquid",
  1704. walkable = false,
  1705. pointable = false,
  1706. diggable = false,
  1707. buildable_to = true,
  1708. is_ground_content = false,
  1709. drop = "",
  1710. drowning = 4,
  1711. liquidtype = "flowing",
  1712. liquid_alternative_flowing = "default:water_flowing",
  1713. liquid_alternative_source = "default:water_source",
  1714. liquid_viscosity = 1,
  1715. post_effect_color = {a = 103, r = 30, g = 60, b = 90},
  1716. groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
  1717. sounds = default.node_sound_water_defaults(),
  1718. on_collapse_to_entity = function(pos, node)
  1719. -- Do not allow player to obtain the node itself.
  1720. end,
  1721. on_construct = function(pos)
  1722. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1723. minetest.add_node(pos, {name="fire:basic_flame"})
  1724. return
  1725. end
  1726. if rc.current_realm_at_pos(pos) == "channelwood" then
  1727. minetest.swap_node(pos, {name="cw:water_flowing"})
  1728. return
  1729. end
  1730. if pos.y < -25000 then
  1731. minetest.add_node(pos, {name="fire:basic_flame"})
  1732. end
  1733. end,
  1734. })
  1735. minetest.register_node("default:river_water_source", {
  1736. description = "Salt Water Source",
  1737. drawtype = "liquid",
  1738. tiles = {
  1739. {
  1740. name = "default_river_water_source_animated.png",
  1741. animation = {
  1742. type = "vertical_frames",
  1743. aspect_w = 16,
  1744. aspect_h = 16,
  1745. length = 2.0,
  1746. },
  1747. },
  1748. },
  1749. special_tiles = {
  1750. {
  1751. name = "default_river_water_source_animated.png",
  1752. animation = {
  1753. type = "vertical_frames",
  1754. aspect_w = 16,
  1755. aspect_h = 16,
  1756. length = 2.0,
  1757. },
  1758. backface_culling = false,
  1759. },
  1760. },
  1761. alpha = 160,
  1762. paramtype = "light",
  1763. walkable = false,
  1764. pointable = false,
  1765. diggable = false,
  1766. buildable_to = true,
  1767. is_ground_content = false,
  1768. drop = "",
  1769. drowning = 4,
  1770. liquidtype = "source",
  1771. liquid_alternative_flowing = "default:river_water_flowing",
  1772. liquid_alternative_source = "default:river_water_source",
  1773. liquid_viscosity = 1,
  1774. -- River water can be placed above ground, so liquid must NOT be renewable!
  1775. liquid_renewable = false,
  1776. liquid_range = 2,
  1777. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  1778. groups = {water = 3, liquid = 3, puts_out_fire = 1},
  1779. sounds = default.node_sound_water_defaults(),
  1780. -- Water turns to fire in the nether.
  1781. -- Note: this is not called if water-source is created by the engine due to liquid-flow mechanic.
  1782. on_construct = function(pos)
  1783. farming.notify_soil(pos)
  1784. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1785. minetest.add_node(pos, {name="fire:basic_flame"})
  1786. return
  1787. end
  1788. if pos.y < -25000 then
  1789. minetest.add_node(pos, {name="fire:basic_flame"})
  1790. end
  1791. end,
  1792. on_destruct = function(pos)
  1793. farming.notify_soil(pos)
  1794. end,
  1795. on_collapse_to_entity = function(pos, node)
  1796. -- Do not allow player to obtain the node itself.
  1797. end,
  1798. })
  1799. minetest.register_node("default:river_water_flowing", {
  1800. description = "Flowing Salt Water",
  1801. drawtype = "flowingliquid",
  1802. tiles = {"default_river_water.png"},
  1803. special_tiles = {
  1804. {
  1805. name = "default_river_water_flowing_animated.png",
  1806. backface_culling = false,
  1807. animation = {
  1808. type = "vertical_frames",
  1809. aspect_w = 16,
  1810. aspect_h = 16,
  1811. length = 0.8,
  1812. },
  1813. },
  1814. {
  1815. name = "default_river_water_flowing_animated.png",
  1816. backface_culling = true,
  1817. animation = {
  1818. type = "vertical_frames",
  1819. aspect_w = 16,
  1820. aspect_h = 16,
  1821. length = 0.8,
  1822. },
  1823. },
  1824. },
  1825. alpha = 160,
  1826. paramtype = "light",
  1827. paramtype2 = "flowingliquid",
  1828. walkable = false,
  1829. pointable = false,
  1830. diggable = false,
  1831. buildable_to = true,
  1832. is_ground_content = false,
  1833. drop = "",
  1834. drowning = 4,
  1835. liquidtype = "flowing",
  1836. liquid_alternative_flowing = "default:river_water_flowing",
  1837. liquid_alternative_source = "default:river_water_source",
  1838. liquid_viscosity = 1,
  1839. -- River water can be placed above ground, so liquid must NOT be renewable!
  1840. liquid_renewable = false,
  1841. liquid_range = 2,
  1842. post_effect_color = {a = 103, r = 30, g = 76, b = 90},
  1843. groups = {water = 3, liquid = 3, puts_out_fire = 1, not_in_creative_inventory = 1},
  1844. sounds = default.node_sound_water_defaults(),
  1845. on_collapse_to_entity = function(pos, node)
  1846. -- Do not allow player to obtain the node itself.
  1847. end,
  1848. on_construct = function(pos)
  1849. if minetest.find_node_near(pos, 10, "griefer:grieferstone") then
  1850. minetest.set_node(pos, {name="fire:basic_flame"})
  1851. return
  1852. end
  1853. if pos.y < -25000 then
  1854. minetest.set_node(pos, {name="fire:basic_flame"})
  1855. end
  1856. end,
  1857. })
  1858. --
  1859. -- Tools / "Advanced" crafting / Non-"natural"
  1860. --
  1861. minetest.register_node("default:ladder_wood", {
  1862. description = "Wooden Ladder",
  1863. drawtype = "signlike",
  1864. tiles = {"default_ladder_wood.png"},
  1865. inventory_image = "default_ladder_wood.png",
  1866. wield_image = "default_ladder_wood.png",
  1867. paramtype = "light",
  1868. paramtype2 = "wallmounted",
  1869. sunlight_propagates = true,
  1870. walkable = false,
  1871. climbable = true,
  1872. is_ground_content = false,
  1873. selection_box = {
  1874. type = "wallmounted",
  1875. --wall_top = = <default>
  1876. --wall_bottom = = <default>
  1877. --wall_side = = <default>
  1878. },
  1879. groups = utility.dig_groups("bigitem", {flammable = 2, ladder=1}),
  1880. legacy_wallmounted = true,
  1881. sounds = default.node_sound_wood_defaults(),
  1882. -- Lava burns wood ladders instantly.
  1883. -- Water rots wood (instantly too, I guess).
  1884. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1885. floodable = true,
  1886. })
  1887. minetest.register_node("default:ladder_steel", {
  1888. description = "Wrought Iron Ladder",
  1889. drawtype = "signlike",
  1890. tiles = {"default_ladder_steel.png"},
  1891. inventory_image = "default_ladder_steel.png",
  1892. wield_image = "default_ladder_steel.png",
  1893. paramtype = "light",
  1894. paramtype2 = "wallmounted",
  1895. sunlight_propagates = true,
  1896. walkable = false,
  1897. climbable = true,
  1898. is_ground_content = false,
  1899. selection_box = {
  1900. type = "wallmounted",
  1901. --wall_top = = <default>
  1902. --wall_bottom = = <default>
  1903. --wall_side = = <default>
  1904. },
  1905. groups = utility.dig_groups("bigitem", {ladder=1}),
  1906. sounds = default.node_sound_metal_defaults(),
  1907. -- Lava melts metal ladders quickly.
  1908. -- Water rusts them (quickly too, I guess).
  1909. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1910. floodable = true,
  1911. })
  1912. minetest.register_node(":defauIt:ladder_wood", {
  1913. description = "Wooden Trap Ladder",
  1914. drawtype = "signlike",
  1915. tiles = {"default_ladder_wood.png"},
  1916. inventory_image = "default_ladder_wood.png",
  1917. wield_image = "default_ladder_wood.png",
  1918. paramtype = "light",
  1919. paramtype2 = "wallmounted",
  1920. sunlight_propagates = true,
  1921. walkable = false,
  1922. climbable = false, -- Player drops through.
  1923. is_ground_content = false,
  1924. selection_box = {
  1925. type = "wallmounted",
  1926. --wall_top = = <default>
  1927. --wall_bottom = = <default>
  1928. --wall_side = = <default>
  1929. },
  1930. groups = utility.dig_groups("bigitem", {flammable = 2}),
  1931. sounds = default.node_sound_wood_defaults(),
  1932. -- Lava burns wood ladders instantly.
  1933. -- Water rots wood (instantly too, I guess).
  1934. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1935. floodable = true,
  1936. })
  1937. minetest.register_node(":defauIt:ladder_steel", {
  1938. description = "Wrought Iron Trap Ladder",
  1939. drawtype = "signlike",
  1940. tiles = {"default_ladder_steel.png"},
  1941. inventory_image = "default_ladder_steel.png",
  1942. wield_image = "default_ladder_steel.png",
  1943. paramtype = "light",
  1944. paramtype2 = "wallmounted",
  1945. sunlight_propagates = true,
  1946. walkable = false,
  1947. climbable = false, -- Player drops through.
  1948. is_ground_content = false,
  1949. selection_box = {
  1950. type = "wallmounted",
  1951. --wall_top = = <default>
  1952. --wall_bottom = = <default>
  1953. --wall_side = = <default>
  1954. },
  1955. groups = utility.dig_groups("bigitem"),
  1956. sounds = default.node_sound_metal_defaults(),
  1957. -- Lava melts metal ladders quickly.
  1958. -- Water rusts them (quickly too, I guess).
  1959. -- Gameplay rational: make it important to use trapdoors, etc. to block flow.
  1960. floodable = true,
  1961. })
  1962. default.register_fence("default:fence_iron", {
  1963. description = "Wrought Iron Fence",
  1964. texture = "default_fence_iron.png",
  1965. inventory_image = "default_fence_overlay.png^default_fence_iron.png^default_fence_overlay.png^[makealpha:255,126,126",
  1966. wield_image = "default_fence_overlay.png^default_fence_iron.png^default_fence_overlay.png^[makealpha:255,126,126",
  1967. material = "default:steel_ingot",
  1968. groups = utility.dig_groups("fence_metal", {fence = 1}),
  1969. sounds = default.node_sound_metal_defaults()
  1970. })
  1971. default.register_fence("default:fence_bronze", {
  1972. description = "Bronze Fence",
  1973. texture = "default_fence_bronze.png",
  1974. inventory_image = "default_fence_overlay.png^default_fence_bronze.png^default_fence_overlay.png^[makealpha:255,126,126",
  1975. wield_image = "default_fence_overlay.png^default_fence_bronze.png^default_fence_overlay.png^[makealpha:255,126,126",
  1976. material = "default:bronze_ingot",
  1977. groups = utility.dig_groups("fence_metal", {fence = 1}),
  1978. sounds = default.node_sound_metal_defaults()
  1979. })
  1980. default.register_fence("default:fence_wood", {
  1981. description = "Wooden Fence",
  1982. texture = "default_fence_wood.png",
  1983. inventory_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  1984. wield_image = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  1985. material = "default:wood",
  1986. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  1987. sounds = default.node_sound_wood_defaults()
  1988. })
  1989. default.register_fence("default:fence_acacia_wood", {
  1990. description = "Acacia Wood Fence",
  1991. texture = "default_fence_acacia_wood.png",
  1992. inventory_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  1993. wield_image = "default_fence_overlay.png^default_acacia_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  1994. material = "default:acacia_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_junglewood", {
  1999. description = "Jungle Wood Fence",
  2000. texture = "default_fence_junglewood.png",
  2001. inventory_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2002. wield_image = "default_fence_overlay.png^default_junglewood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2003. material = "default:junglewood",
  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_pine_wood", {
  2008. description = "Pine Wood Fence",
  2009. texture = "default_fence_pine_wood.png",
  2010. inventory_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2011. wield_image = "default_fence_overlay.png^default_pine_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2012. material = "default:pine_wood",
  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_aspen_wood", {
  2017. description = "Aspen Wood Fence",
  2018. texture = "default_fence_aspen_wood.png",
  2019. inventory_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2020. wield_image = "default_fence_overlay.png^default_aspen_wood.png^default_fence_overlay.png^[makealpha:255,126,126",
  2021. material = "default:aspen_wood",
  2022. groups = utility.dig_groups("fence_wood", {flammable = 2, fence = 1}),
  2023. sounds = default.node_sound_wood_defaults()
  2024. })
  2025. minetest.register_node("default:glass", {
  2026. description = "Glass",
  2027. drawtype = "glasslike_framed_optional",
  2028. tiles = {"default_glass.png", "default_glass_detail.png"},
  2029. paramtype = "light",
  2030. sunlight_propagates = true,
  2031. is_ground_content = false,
  2032. groups = utility.dig_groups("glass", {glass=1}),
  2033. sounds = default.node_sound_glass_defaults(),
  2034. drop = "vessels:glass_fragments",
  2035. silverpick_drop = true,
  2036. })
  2037. minetest.register_node("default:obsidian_glass", {
  2038. description = "Obsidian Glass",
  2039. drawtype = "glasslike_framed_optional",
  2040. tiles = {"default_obsidian_glass.png", "default_obsidian_glass_detail.png"},
  2041. paramtype = "light",
  2042. is_ground_content = false,
  2043. sunlight_propagates = true,
  2044. sounds = default.node_sound_glass_defaults(),
  2045. groups = utility.dig_groups("glass", {glass=1}),
  2046. drop = "default:obsidian_shard",
  2047. silverpick_drop = true,
  2048. })
  2049. minetest.register_node("default:brick", {
  2050. description = "Brick Block",
  2051. paramtype2 = "facedir",
  2052. place_param2 = 0,
  2053. tiles = {"default_brick.png"},
  2054. is_ground_content = false,
  2055. groups = utility.dig_groups("brick", {brick = 1}),
  2056. sounds = default.node_sound_stone_defaults(),
  2057. })
  2058. minetest.register_node("default:meselamp", {
  2059. description = "Mese Lamp",
  2060. drawtype = "glasslike",
  2061. tiles = {"default_meselamp.png"},
  2062. paramtype = "light",
  2063. sunlight_propagates = true,
  2064. is_ground_content = false,
  2065. groups = utility.dig_groups("glass"),
  2066. sounds = default.node_sound_glass_defaults(),
  2067. light_source = default.LIGHT_MAX-1,
  2068. })
  2069. minetest.register_node("default:lightbox", {
  2070. description = "Light Box",
  2071. drawtype = "glasslike",
  2072. tiles = {"default_lightbox.png"},
  2073. paramtype = "light",
  2074. sunlight_propagates = true,
  2075. is_ground_content = false,
  2076. groups = utility.dig_groups("glass"),
  2077. sounds = default.node_sound_glass_defaults(),
  2078. light_source = default.LIGHT_MAX - 2,
  2079. })