lb_default.lua 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535
  1. local S = lucky_block.intllib
  2. local MP = minetest.get_modpath("lucky_block")
  3. -- default mod
  4. if lucky_block.def_mod then
  5. -- chest items
  6. lucky_block:add_chest_items({
  7. {name = "default:wood", max = 5},
  8. {name = "default:apple", max = 3},
  9. {name = "default:steel_ingot", max = 3},
  10. {name = "default:gold_ingot", max = 3, chance = 2},
  11. {name = "default:diamond", max = 2, chance = 3},
  12. {name = "default:mese_crystal_fragment", max = 3, chance = 3},
  13. {name = "default:pick_steel", max = 1, chance = 2, min_wear = 20000, max_wear = 65536}
  14. })
  15. local dpath = minetest.get_modpath("default") .. "/schematics/"
  16. -- Default tree schematics
  17. lucky_block:add_schematics({
  18. {"appletree", dpath .. "apple_tree_from_sapling.mts", {x = 3, y = 1, z = 3}},
  19. {"jungletree", dpath .. "jungle_tree_from_sapling.mts", {x = 2, y = 1, z = 2}},
  20. {"defpinetree", dpath .. "pine_tree_from_sapling.mts", {x = 2, y = 1, z = 2}},
  21. {"acaciatree", dpath .. "acacia_tree_from_sapling.mts", {x = 4, y = 1, z = 4}},
  22. {"aspentree", dpath .. "aspen_tree_from_sapling.mts", {x = 2, y = 1, z = 2}},
  23. {"largecactus", dpath .. "large_cactus.mts", {x = 2, y = 1, z = 2}},
  24. {"defaultbush", dpath .. "bush.mts", {x = 1, y = 1, z = 1}},
  25. {"acaciabush", dpath .. "acacia_bush.mts", {x = 1, y = 1, z = 1}},
  26. {"corals", MP .. "/schematics/corals.mts", {x = 2, y = 1, z = 2}}
  27. })
  28. -- Default lucky blocks
  29. lucky_block:add_blocks({
  30. {"nod", {"default:chest"}, 0},
  31. {"lig"},
  32. {"fal", {"default:wood", "default:gravel", "default:sand",
  33. "default:desert_sand", "default:stone", "default:dirt",
  34. "default:goldblock"}, 0},
  35. {"sch", "watertrap", 1, true},
  36. {"tel"},
  37. {"dro", {"default:apple"}, 10},
  38. {"sch", "appletree", 0, false},
  39. {"dro", {"default:snow"}, 10},
  40. {"nod", "default:chest", 0, {
  41. {name = "bucket:bucket_water", max = 1},
  42. {name = "default:wood", max = 3},
  43. {name = "default:pick_diamond", max = 1},
  44. {name = "default:coal_lump", max = 3}
  45. }},
  46. {"sch", "sandtrap", 1, true},
  47. {"sch", "defpinetree", 0, false},
  48. {"sch", "lavatrap", 1, true},
  49. {"dro", {"default:mese_crystal_fragment"}, 15},
  50. {"dro", {"default:mese_crystal"}, 10},
  51. {"dro", {"default:mese"}, 1},
  52. {"exp", 2},
  53. {"sch", "acaciabush", 0, false},
  54. {"nod", "default:diamondblock", 0},
  55. {"nod", "default:steelblock", 0},
  56. {"nod", "default:dirt", 0},
  57. {"nod", "default:chest", 0, {
  58. {name = "default:dirt", max = 15},
  59. {name = "default:dirt_with_dry_grass", max = 15},
  60. {name = "default:dirt_with_rainforest_litter", max = 15},
  61. {name = "default:dirt_with_grass", max = 15},
  62. {name = "default:dirt_with_snow", max = 15},
  63. }},
  64. {"dro", {"dye:"}, 10, true},
  65. {"dro", {"default:sword_steel"}},
  66. {"sch", "jungletree", 0, false},
  67. {"sch", "sandtrap", 1, true, {{"default:sand", "default:silver_sand"}} },
  68. {"dro", {"default:pick_steel"}},
  69. {"dro", {"default:shovel_steel"}},
  70. {"exp"},
  71. {"dro", {"default:coal_lump"}, 3},
  72. {"sch", "defaultbush", 0, false},
  73. {"tro", "default:mese", "tnt_blast", true},
  74. {"sch", "acaciatree", 0, false},
  75. {"dro", {"default:axe_steel"}},
  76. {"dro", {"default:sword_bronze"}},
  77. {"exp", 3},
  78. {"nod", "default:chest", 0, {
  79. {name = "default:acacia_sapling", max = 10},
  80. {name = "default:aspen_sapling", max = 10},
  81. {name = "default:pine_sapling", max = 10},
  82. {name = "default:sapling", max = 10},
  83. {name = "default:junglesapling", max = 10},
  84. {name = "default:acacia_bush_sapling", max = 5},
  85. {name = "default:bush_sapling", max = 5},
  86. }},
  87. {"sch", "platform", 1, true},
  88. {"nod", "default:wood", 0},
  89. {"dro", {"default:pick_bronze"}},
  90. {"sch", "aspentree", 0, false},
  91. {"dro", {"default:shovel_bronze"}},
  92. {"nod", "default:gravel", 0},
  93. {"sch", "sandtrap", 1, true, {{"default:sand", "default:gravel"}} },
  94. {"sch", "largecactus", 0, false},
  95. {"dro", {"default:axe_bronze"}},
  96. {"dro", {"default:bookshelf", "default:book", "default:paper"}, 5},
  97. {"dro", {"default:fence_wood"}, 10},
  98. {"dro", {"default:fence_acacia_wood"}, 10},
  99. {"dro", {"default:fence_aspen_wood"}, 10},
  100. {"dro", {"default:fence_junglewood"}, 10},
  101. {"dro", {"default:fence_pine_wood"}, 10},
  102. {"sch", "obsidiantrap", 1, true},
  103. {"sch", "sandtrap", 1, true, {{"default:sand", "default:desert_sand"}} },
  104. {"nod", "default:chest", 0, {
  105. {name = "default:acacia_wood", max = 10},
  106. {name = "default:aspen_wood", max = 10},
  107. {name = "default:pine_wood", max = 10},
  108. {name = "default:wood", max = 10},
  109. {name = "default:junglewood", max = 10},
  110. }},
  111. {"nod", "default:chest", 0, {
  112. {name = "default:acacia_tree", max = 10},
  113. {name = "default:aspen_tree", max = 10},
  114. {name = "default:pine_tree", max = 10},
  115. {name = "default:tree", max = 10},
  116. {name = "default:jungletree", max = 10},
  117. }},
  118. {"dro", {"default:coral_brown"}, 5},
  119. {"dro", {"default:coral_orange"}, 5},
  120. {"dro", {"default:coral_skeleton"}, 5},
  121. {"sch", "corals", 0, true},
  122. {"dro", {"default:mese_post_light"}, 5},
  123. {"dro", {"default:fence_wood"}, 5},
  124. {"nod", "default:mese_post_light"},
  125. {"dro", {"default:silver_sand"}, 20},
  126. {"dro", {"default:sand"}, 20},
  127. {"dro", {"default:desert_sand"}, 20},
  128. {"dro", {"default:gravel"}, 15},
  129. {"nod", "default:chest", 0, {
  130. {name = "default:silver_sand", max = 20},
  131. {name = "default:silver_sandstone", max = 20},
  132. {name = "default:desert_sand", max = 20},
  133. {name = "default:silver_sandstone", max = 20},
  134. {name = "default:sand", max = 20},
  135. {name = "default:sandstone", max = 20},
  136. {name = "default:gravel", max = 20},
  137. }},
  138. {"dro", {"default:obsidian"}, 14}
  139. })
  140. -- Additional Wishing Well Styles
  141. lucky_block:add_blocks({
  142. {"sch", "wishingwell", 0, true},
  143. {"sch", "wishingwell", 0, true, {
  144. {"default:stonebrick", "default:silver_sandstone_brick"},
  145. {"stairs:slab_stonebrick", "stairs:slab_silver_sandstone_brick"},
  146. {"default:fence_wood", "default:fence_aspen_wood"},
  147. {"default:steelblock", "default:tinblock"},
  148. } },
  149. {"sch", "wishingwell", 0, true, {
  150. {"default:stonebrick", "default:sandstonebrick"},
  151. {"stairs:slab_stonebrick", "stairs:slab_sandstonebrick"},
  152. {"default:fence_wood", "default:fence_junglewood"},
  153. {"default:steelblock", "default:goldblock"},
  154. } },
  155. {"sch", "wishingwell", 0, true, {
  156. {"default:stonebrick", "default:desert_stonebrick"},
  157. {"stairs:slab_stonebrick", "stairs:slab_desert_stonebrick"},
  158. {"default:fence_wood", "default:fence_acacia_wood"},
  159. {"default:steelblock", "default:copperblock"},
  160. } },
  161. {"sch", "wishingwell", 0, true, {
  162. {"default:stonebrick", "default:desert_sandstone_brick"},
  163. {"stairs:slab_stonebrick", "stairs:slab_desert_sandstone_brick"},
  164. {"default:fence_wood", "default:fence_pine_wood"},
  165. {"default:steelblock", "default:bronzeblock"},
  166. } },
  167. })
  168. end
  169. -- wool mod
  170. if minetest.get_modpath("wool") then
  171. lucky_block:add_blocks({
  172. {"sch", "sandtrap", 1, true, {{"default:sand", "wool:red"}} },
  173. {"dro", {"wool:"}, 10, true},
  174. {"sch", "sandtrap", 1, true, {{"default:sand", "wool:green"}} },
  175. {"dro", {"wool:white"}, 10}
  176. })
  177. end
  178. -- Flowers mod
  179. if minetest.get_modpath("flowers") then
  180. lucky_block:add_blocks({
  181. {"nod", "flowers:rose", 0},
  182. {"dro", {"flowers:mushroom_red"}, 5},
  183. {"dro", {"flowers:mushroom_brown"}, 5},
  184. {"dro", {"flowers:rose", "flowers:tulip", "flowers:dandelion_yellow",
  185. "flowers:geranium", "flowers:viola", "flowers:dandelion_white"}, 12},
  186. {"nod", "default:chest", 0, {
  187. {name = "flowers:geranium", max = 15},
  188. {name = "flowers:viola", max = 15},
  189. {name = "flowers:dandelion_white", max = 15},
  190. {name = "flowers:dandelion_yellow", max = 15},
  191. {name = "flowers:tulip", max = 15},
  192. {name = "flowers:rose", max = 15},
  193. {name = "flowers:mushroom_brown", max = 10},
  194. {name = "flowers:mushroom_red", max = 10},
  195. {name = "flowers:waterlily", max = 10}
  196. }}
  197. })
  198. end
  199. -- Doors mod
  200. if minetest.get_modpath("doors") then
  201. lucky_block:add_blocks({
  202. {"dro", {"doors:door_wood"}},
  203. {"dro", {"doors:door_steel"}},
  204. {"dro", {"doors:door_glass"}},
  205. {"dro", {"doors:door_obsidian_glass"}},
  206. {"dro", {"doors:trapdoor"}},
  207. {"dro", {"doors:trapdoor_steel"}},
  208. {"dro", {"doors:gate_acacia_wood_closed"}},
  209. {"dro", {"doors:gate_aspen_wood_closed"}},
  210. {"dro", {"doors:gate_wood_closed"}},
  211. {"dro", {"doors:gate_pine_wood_closed"}},
  212. {"dro", {"doors:gate_junglewood_closed"}}
  213. })
  214. end
  215. -- Screwdriver mod
  216. if minetest.get_modpath("screwdriver") then
  217. if screwdriver and screwdriver.handler then
  218. minetest.register_tool(":screwdriver:screwdriver_magenta", {
  219. description = S("Super Mega Magenta Ultra Screwdriver 2500"
  220. .. "\n(left-click to rotate face, right-click to rotates axis)"),
  221. inventory_image = "screwdriver.png^[colorize:#ff009970",
  222. groups = {not_in_creative_inventory = 1},
  223. on_use = function(itemstack, user, pointed_thing)
  224. screwdriver.handler(itemstack, user, pointed_thing,
  225. screwdriver.ROTATE_FACE, 2500)
  226. return itemstack
  227. end,
  228. on_place = function(itemstack, user, pointed_thing)
  229. screwdriver.handler(itemstack, user, pointed_thing,
  230. screwdriver.ROTATE_AXIS, 2500)
  231. return itemstack
  232. end
  233. })
  234. end
  235. lucky_block:add_blocks({
  236. {"dro", {"screwdriver:screwdriver"}},
  237. {"dro", {"screwdriver:screwdriver_magenta"}},
  238. })
  239. end
  240. -- Vessels mod
  241. if minetest.get_modpath("vessels") then
  242. lucky_block:add_blocks({
  243. {"dro", {"vessels:shelf", "vessels:drinking_glass", "vessels:glass_bottle",
  244. "vessels:steel_bottle", "vessels:glass_fragments"}, 5},
  245. {"nod", "vessels:drinking_glass", 0},
  246. {"nod", "vessels:glass_bottle", 0},
  247. {"nod", "vessels:steel_bottle", 0}
  248. })
  249. end
  250. -- Farming mod (default)
  251. if minetest.get_modpath("farming") then
  252. lucky_block:add_blocks({
  253. {"dro", {"farming:bread"}, 5},
  254. {"sch", "instafarm", 0, true},
  255. {"nod", "default:water_source", 1},
  256. {"nod", "farming:straw", 0},
  257. {"dro", {"farming:straw"}, 8}
  258. })
  259. end
  260. -- Boats mod
  261. if minetest.get_modpath("boats") then
  262. lucky_block:add_blocks({
  263. {"dro", {"boats:boat"}}
  264. })
  265. end
  266. -- Beds mod
  267. if minetest.get_modpath("beds") then
  268. lucky_block:add_blocks({
  269. {"dro", {"beds:bed"}},
  270. {"dro", {"beds:fancy_bed"}}
  271. })
  272. end
  273. -- Walls mod
  274. if minetest.get_modpath("walls") then
  275. lucky_block:add_blocks({
  276. {"dro", {"walls:cobble"}, 10},
  277. {"dro", {"walls:mossycobble"}, 10},
  278. {"dro", {"walls:desertcobble"}, 10}
  279. })
  280. end
  281. -- Carts mod
  282. if minetest.get_modpath("carts")
  283. or minetest.get_modpath("boost_cart") then
  284. lucky_block:add_blocks({
  285. {"dro", {"carts:cart"}},
  286. {"dro", {"default:rail"}, 10},
  287. {"dro", {"carts:powerrail"}, 5},
  288. {"dro", {"carts:brakerail"}, 5}
  289. })
  290. end
  291. -- 3D Armor mod
  292. if minetest.get_modpath("3d_armor") then
  293. lucky_block:add_blocks({
  294. {"dro", {"3d_armor:boots_wood"}},
  295. {"dro", {"3d_armor:leggings_wood"}},
  296. {"dro", {"3d_armor:chestplate_wood"}},
  297. {"dro", {"3d_armor:helmet_wood"}},
  298. {"tel"},
  299. {"dro", {"3d_armor:boots_steel"}},
  300. {"dro", {"3d_armor:leggings_steel"}},
  301. {"dro", {"3d_armor:chestplate_steel"}},
  302. {"dro", {"3d_armor:helmet_steel"}},
  303. {"dro", {"3d_armor:boots_gold"}},
  304. {"dro", {"3d_armor:leggings_gold"}},
  305. {"dro", {"3d_armor:chestplate_gold"}},
  306. {"exp"},
  307. {"dro", {"3d_armor:helmet_gold"}},
  308. {"dro", {"3d_armor:boots_cactus"}},
  309. {"dro", {"3d_armor:leggings_cactus"}},
  310. {"dro", {"3d_armor:chestplate_cactus"}},
  311. {"dro", {"3d_armor:helmet_cactus"}},
  312. {"dro", {"3d_armor:boots_bronze"}},
  313. {"dro", {"3d_armor:leggings_bronze"}},
  314. {"dro", {"3d_armor:chestplate_bronze"}},
  315. {"dro", {"3d_armor:helmet_bronze"}},
  316. {"lig"}
  317. })
  318. end
  319. -- 3D Armor's Shields mod
  320. if minetest.get_modpath("shields") then
  321. lucky_block:add_blocks({
  322. {"dro", {"shields:shield_wood"}},
  323. {"dro", {"shields:shield_steel"}},
  324. {"dro", {"shields:shield_gold"}},
  325. {"dro", {"shields:shield_cactus"}},
  326. {"dro", {"shields:shield_bronze"}},
  327. {"exp", 2}
  328. })
  329. end
  330. -- Fire mod
  331. if minetest.get_modpath("fire") then
  332. lucky_block:add_blocks({
  333. {"dro", {"fire:flint_and_steel"}},
  334. {"dro", {"default:flint"}, 5},
  335. {"nod", "fire:basic_flame", 1},
  336. {"nod", "fire:permanent_flame", 1},
  337. {"sch", "firetrap", 1, true},
  338. })
  339. end
  340. -- TNT mod
  341. if minetest.get_modpath("tnt") then
  342. local p = "tnt:tnt_burning"
  343. lucky_block:add_blocks({
  344. {"dro", {"tnt:gunpowder"}, 5},
  345. {"fal", {p, p, p, p, p}, 1, true, 4},
  346. {"nod", "tnt:tnt_burning", 0}
  347. })
  348. end
  349. -- More Ore's mod
  350. if minetest.get_modpath("moreores") then
  351. lucky_block:add_blocks({
  352. {"nod", "moreores:tin_block", 0},
  353. {"nod", "moreores:silver_block", 0},
  354. {"fal", {"default:sand", "default:sand", "default:sand", "default:sand",
  355. "default:sand", "default:sand", "moreores:mithril_block"}, 0},
  356. {"dro", {"moreores:pick_silver"}},
  357. {"dro", {"moreores:pick_mithril"}},
  358. {"tro", "moreores:silver_block"},
  359. {"dro", {"moreores:shovel_silver"}},
  360. {"dro", {"moreores:shovel_mithril"}},
  361. {"dro", {"moreores:axe_silver"}},
  362. {"dro", {"moreores:axe_mithril"}},
  363. {"tro", "moreores:mithril_block"},
  364. {"dro", {"moreores:hoe_silver"}},
  365. {"dro", {"moreores:hoe_mithril"}},
  366. {"lig"},
  367. {"nod", "default:chest", 0, {
  368. {name = "moreores:silver_lump", max = 10},
  369. {name = "moreores:mithril_lump", max = 10},
  370. {name = "default:copper_lump", max = 10},
  371. {name = "default:gold_lump", max = 10},
  372. {name = "default:iron_lump", max = 10},
  373. {name = "default:tin_lump", max = 10},
  374. {name = "default:coal_lump", max = 10},
  375. {name = "default:clay_lump", max = 10}
  376. }}
  377. })
  378. if minetest.get_modpath("3d_armor") then
  379. lucky_block:add_blocks({
  380. {"dro", {"3d_armor:helmet_mithril"}},
  381. {"dro", {"3d_armor:chestplate_mithril"}},
  382. {"dro", {"3d_armor:leggings_mithril"}},
  383. {"dro", {"3d_armor:boots_mithril"}}
  384. })
  385. end
  386. if minetest.get_modpath("shields") then
  387. lucky_block:add_blocks({
  388. {"dro", {"shields:shield_mithril"}}
  389. })
  390. end
  391. end -- END moreores
  392. -- Bags mod
  393. if minetest.get_modpath("bags") or minetest.get_modpath("sfinv_bags") then
  394. minetest.register_craftitem(":bags:spar", {
  395. description = "Spar Bag",
  396. inventory_image = "bags_spar.png",
  397. groups = {bagslots = 2, flammable = 2}
  398. })
  399. lucky_block:add_blocks({
  400. {"dro", {"bags:spar"}},
  401. {"dro", {"bags:small"}},
  402. {"dro", {"bags:medium"}},
  403. {"dro", {"bags:large"}},
  404. {"dro", {"bags:trolley"}}
  405. })
  406. end
  407. -- Nether Mod
  408. if minetest.get_modpath("nether") then
  409. local p = "nether:"
  410. -- add well blocks
  411. lucky_block.wellblocks[#lucky_block.wellblocks + 1] = {p.."glowstone", 4}
  412. lucky_block.wellblocks[#lucky_block.wellblocks + 1] = {p.."glowstone_deep", 4}
  413. -- add lucky blocks
  414. lucky_block:add_blocks({
  415. {"flo", 3, {"nether:rack", "nether:brick", "nether:brick_cracked"}, 1},
  416. {"flo", 3, {"nether:rack_deep", "nether:brick_deep"}, 1},
  417. {"flo", 3, {"nether:basalt", "nether:basalt_hewn", "nether:basalt_chiselled"}, 1},
  418. {"nod", "nether:glowstone", 0},
  419. {"nod", "nether:glowstone_deep", 0},
  420. {"exp", 3},
  421. {"fal", {p.."sand", p.."sand", p.."sand", p.."sand", p.."sand", p.."glowstone"}, 0},
  422. {"nod", "nether:lava_crust", 1},
  423. {"nod", "default:chest", 0, {
  424. {name = p.."fence_nether_brick", max = 5},
  425. {name = p.."rack_wall", max = 5},
  426. {name = p.."rack", max = 5},
  427. {name = p.."axe_nether", max = 1},
  428. {name = p.."sword_nether", max = 1},
  429. {name = p.."nether_lump", max = 3}
  430. }},
  431. {"exp", 2},
  432. {"sch", "wishingwell", 0, true, {
  433. {"default:stonebrick", p.."brick"},
  434. {"stairs:slab_stonebrick", "stairs:slab_nether_brick"},
  435. {"default:fence_wood", p.."fence_nether_brick"},
  436. {"default:steelblock", p.."basalt_chiselled"},
  437. {"default:water_source", "default:lava_source"},
  438. {"default:glass", "default:obsidian_glass"}
  439. }},
  440. {"lig"},
  441. {"sch", "platform", 1, true, {
  442. {"default:sandstonebrick", p.."brick_deep"},
  443. {"default:sandstone", p.."rack_deep"},
  444. {"lucky_block:lucky_block", "lucky_block:super_lucky_block"}
  445. }},
  446. {"nod", "default:chest", 0, {
  447. {name = p.."rack_deep_wall", max = 5},
  448. {name = p.."rack_deep", max = 5},
  449. {name = p.."pick_nether", max = 1},
  450. {name = p.."shovel_nether", max = 1},
  451. {name = p.."nether_lump", max = 3}
  452. }},
  453. })
  454. if minetest.get_modpath("3d_armor") then
  455. lucky_block:add_blocks({
  456. {"dro", {"3d_armor:helmet_nether"}},
  457. {"dro", {"3d_armor:chestplate_nether"}},
  458. {"dro", {"3d_armor:leggings_nether"}},
  459. {"dro", {"3d_armor:boots_nether"}}
  460. })
  461. end
  462. if minetest.get_modpath("shields") then
  463. lucky_block:add_blocks({
  464. {"dro", {"shields:shield_nether"}}
  465. })
  466. end
  467. if minetest.get_modpath("xpanes") and minetest.registered_nodes["nether:geode"] then
  468. lucky_block:add_blocks({
  469. {"dro", {"xpanes:nether_crystal_pane_flat"}, 5},
  470. {"nod", "nether_geode", 0},
  471. {"dro", {"nether_geode"}, 3}
  472. })
  473. end
  474. end