extra.lua 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415
  1. local S = ethereal.intllib
  2. -- Etherium Dust
  3. minetest.register_craftitem("ethereal:etherium_dust", {
  4. description = S("Etherium Dust"),
  5. inventory_image = "ethereal_etherium_dust.png",
  6. wield_image = "ethereal_etherium_dust.png"
  7. })
  8. -- Ethereium Ore
  9. minetest.register_node("ethereal:etherium_ore", {
  10. description = S("Etherium Ore"),
  11. tiles = {"default_desert_stone.png^ethereal_etherium_ore.png"},
  12. groups = {cracky = 3},
  13. drop = "ethereal:etherium_dust",
  14. sounds = default.node_sound_stone_defaults()
  15. })
  16. minetest.register_node("ethereal:stone_with_etherium_ore", {
  17. description = S("Etherium Ore"),
  18. tiles = {"default_stone.png^ethereal_etherium_ore.png"},
  19. groups = {cracky = 3},
  20. drop = "ethereal:etherium_dust",
  21. sounds = default.node_sound_stone_defaults()
  22. })
  23. -- Bamboo Flooring
  24. minetest.register_node("ethereal:bamboo_floor", {
  25. description = S("Bamboo Floor"),
  26. drawtype = "nodebox",
  27. tiles = {"ethereal_bamboo_floor.png"},
  28. wield_image = "ethereal_bamboo_floor.png",
  29. inventory_image = "ethereal_bamboo_floor.png",
  30. paramtype = "light",
  31. paramtype2 = "wallmounted",
  32. walkable = true,
  33. node_box = {
  34. type = "wallmounted",
  35. wall_top = {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
  36. wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  37. wall_side = {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5}
  38. },
  39. selection_box = {type = "wallmounted"},
  40. groups = {snappy = 3, choppy = 3 , flammable = 2},
  41. sounds = default.node_sound_wood_defaults()
  42. })
  43. -- Craft Bamboo into Bamboo Flooring
  44. minetest.register_craft({
  45. output = "ethereal:bamboo_floor 2",
  46. recipe = {
  47. {"ethereal:bamboo", "ethereal:bamboo"},
  48. {"ethereal:bamboo", "ethereal:bamboo"}
  49. }
  50. })
  51. minetest.register_craft({
  52. output = "ethereal:bamboo_block",
  53. recipe = {
  54. {"ethereal:bamboo_floor"},
  55. {"ethereal:bamboo_floor"}
  56. }
  57. })
  58. -- Bamboo Block
  59. minetest.register_node("ethereal:bamboo_block", {
  60. description = S("Bamboo Block"),
  61. tiles = {"ethereal_bamboo_floor.png"},
  62. paramtype = "light",
  63. groups = {snappy = 3, choppy = 3 , flammable = 2, wood = 1},
  64. sounds = default.node_sound_wood_defaults()
  65. })
  66. minetest.register_craft({
  67. output = "ethereal:bamboo_block",
  68. recipe = {
  69. {"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
  70. {"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
  71. {"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"}
  72. }
  73. })
  74. -- Craft Bamboo into Paper
  75. minetest.register_craft({
  76. output = "default:paper 6",
  77. recipe = {
  78. {"ethereal:bamboo", "ethereal:bamboo"},
  79. {"ethereal:bamboo", "ethereal:bamboo"},
  80. {"ethereal:bamboo", "ethereal:bamboo"}
  81. }
  82. })
  83. if ethereal.xcraft == true then
  84. -- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b')
  85. local cheat = {
  86. {"default:cobble", "default:gravel", 5},
  87. {"default:gravel", "default:dirt", 5},
  88. {"default:dirt", "default:sand", 5},
  89. {"default:ice", "default:snow", 20},
  90. {"ethereal:dry_dirt", "default:desert_sand", 5},
  91. {"default:stone", "default:silver_sandstone", 5}
  92. }
  93. for n = 1, #cheat do
  94. minetest.register_craft({
  95. output = cheat[n][2] .. " " .. cheat[n][3],
  96. recipe = {
  97. {cheat[n][1], "", cheat[n][1]},
  98. {"", cheat[n][1], ""},
  99. {cheat[n][1], "", cheat[n][1]}
  100. }
  101. })
  102. end
  103. end -- END if
  104. -- Paper (2x3 string = 4 paper)
  105. minetest.register_craft({
  106. output = "default:paper 2",
  107. recipe = {
  108. {"farming:cotton", "farming:cotton", "farming:cotton"}
  109. }
  110. })
  111. -- Palm Wax
  112. minetest.register_craftitem("ethereal:palm_wax", {
  113. description = S("Palm Wax"),
  114. inventory_image = "ethereal_palm_wax.png",
  115. wield_image = "ethereal_palm_wax.png"
  116. })
  117. minetest.register_craft({
  118. type = "cooking",
  119. cooktime = 10,
  120. output = "ethereal:palm_wax",
  121. recipe = "ethereal:palmleaves"
  122. })
  123. local function add_candle(col, dcol)
  124. local rcol = ""
  125. if col ~= "" then
  126. rcol = col
  127. col = "_" .. col
  128. end
  129. minetest.register_node("ethereal:candle" .. col, {
  130. description = S(dcol .. "Candle"),
  131. drawtype = "plantlike",
  132. inventory_image = "ethereal_candle" .. col .. "_static.png",
  133. wield_image = "ethereal_candle" .. col .. "_static.png",
  134. tiles = {
  135. {
  136. name = "ethereal_candle" .. col .. ".png",
  137. animation = {
  138. type="vertical_frames",
  139. aspect_w = 32,
  140. aspect_h = 32,
  141. length = 1.0
  142. }
  143. }
  144. },
  145. paramtype = "light",
  146. light_source = 11,
  147. sunlight_propagates = true,
  148. walkable = false,
  149. groups = {candle = 1, dig_immediate = 3, attached_node = 1},
  150. sounds = default.node_sound_defaults(),
  151. selection_box = {
  152. type = "fixed",
  153. fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
  154. }
  155. })
  156. if col ~= "" then
  157. minetest.register_craft({
  158. output = "ethereal:candle" .. col,
  159. recipe = {
  160. {"group:candle", "dye:" .. rcol},
  161. }
  162. })
  163. end
  164. end
  165. add_candle("", "")
  166. add_candle("black", "Black ") -- candle colour textures by wRothbard
  167. add_candle("blue", "Blue ")
  168. add_candle("brown", "Brown ")
  169. add_candle("cyan", "Cyan ")
  170. add_candle("dark_green", "Dark Green ")
  171. add_candle("dark_grey", "Dark Grey ")
  172. add_candle("green", "Green ")
  173. add_candle("grey", "Grey ")
  174. add_candle("magenta", "Magenta ")
  175. add_candle("orange", "Orange ")
  176. add_candle("pink", "Pink ")
  177. add_candle("red", "Red ")
  178. add_candle("violet", "Violet ")
  179. add_candle("yellow", "Yellow ")
  180. -- white candle recipe
  181. minetest.register_craft({
  182. output = "ethereal:candle",
  183. recipe = {
  184. {"group:candle", "dye:white"}
  185. }
  186. })
  187. -- candle recipe
  188. minetest.register_craft({
  189. output = "ethereal:candle 2",
  190. recipe = {
  191. {"farming:string"},
  192. {"ethereal:palm_wax"},
  193. {"ethereal:palm_wax"}
  194. }
  195. })
  196. -- Wooden Bowl
  197. minetest.register_craftitem("ethereal:bowl", {
  198. description = S("Bowl"),
  199. inventory_image = "ethereal_bowl.png",
  200. groups = {food_bowl = 1, flammable = 2}
  201. })
  202. -- use farming redo's recipe if found
  203. if not minetest.registered_items["farming:bowl"] then
  204. minetest.register_craft({
  205. output = "ethereal:bowl 4",
  206. recipe = {
  207. {"group:wood", "", "group:wood"},
  208. {"", "group:wood", ""}
  209. }
  210. })
  211. end
  212. -- stone Ladder
  213. minetest.register_node("ethereal:stone_ladder", {
  214. description = S("Stone Ladder"),
  215. drawtype = "signlike",
  216. tiles = {"ethereal_stone_ladder.png"},
  217. inventory_image = "ethereal_stone_ladder.png",
  218. wield_image = "ethereal_stone_ladder.png",
  219. paramtype = "light",
  220. sunlight_propagates = true,
  221. paramtype2 = "wallmounted",
  222. walkable = false,
  223. climbable = true,
  224. is_ground_content = false,
  225. selection_box = {
  226. type = "wallmounted"
  227. },
  228. groups = {cracky = 3, oddly_breakable_by_hand = 1},
  229. legacy_wallmounted = true,
  230. sounds = default.node_sound_stone_defaults()
  231. })
  232. minetest.register_craft({
  233. output = "ethereal:stone_ladder 4",
  234. recipe = {
  235. {"group:stone", "", "group:stone"},
  236. {"group:stone", "group:stone", "group:stone"},
  237. {"group:stone", "", "group:stone"}
  238. }
  239. })
  240. -- Paper Wall
  241. minetest.register_node("ethereal:paper_wall", {
  242. drawtype = "nodebox",
  243. description = S("Paper Wall"),
  244. tiles = {"ethereal_paper_wall.png"},
  245. inventory_image = "ethereal_paper_wall.png",
  246. wield_image = "ethereal_paper_wall.png",
  247. paramtype = "light",
  248. groups = {snappy = 3},
  249. sounds = default.node_sound_wood_defaults(),
  250. walkable = true,
  251. is_ground_content = false,
  252. sunlight_propagates = true,
  253. paramtype2 = "facedir",
  254. selection_box = {
  255. type = "fixed",
  256. fixed = {-0.5, -0.5, 5/11, 0.5, 0.5, 8/16}
  257. },
  258. node_box = {
  259. type = "fixed",
  260. fixed = {
  261. {-0.5, -0.5, 5/11, 0.5, 0.5, 8/16}
  262. }
  263. }
  264. })
  265. minetest.register_craft({
  266. output = "ethereal:paper_wall",
  267. recipe = {
  268. {"group:stick", "default:paper", "group:stick"},
  269. {"group:stick", "default:paper", "group:stick"},
  270. {"group:stick", "default:paper", "group:stick"}
  271. }
  272. })
  273. -- Glostone (A little bit of light decoration)
  274. minetest.register_node("ethereal:glostone", {
  275. description = S("Glo Stone"),
  276. tiles = {"ethereal_glostone.png"},
  277. groups = {cracky = 3},
  278. light_source = 13,
  279. drop = "ethereal:glostone",
  280. sounds = default.node_sound_stone_defaults()
  281. })
  282. minetest.register_craft({
  283. -- type = "shapeless",
  284. output = "ethereal:glostone",
  285. recipe = {
  286. {"", "default:torch", ""},
  287. {"default:torch", "default:stone", "default:torch"},
  288. {"", "dye:yellow", ""}
  289. }
  290. })
  291. -- Charcoal Lump
  292. minetest.register_craftitem("ethereal:charcoal_lump", {
  293. description = S("Lump of Charcoal"),
  294. inventory_image = "ethereal_charcoal_lump.png"
  295. })
  296. minetest.register_craft({
  297. output = "ethereal:charcoal_lump 2",
  298. recipe = {
  299. {"ethereal:scorched_tree"}
  300. }
  301. })
  302. minetest.register_craft({
  303. output = "ethereal:charcoal_lump 2",
  304. type = "cooking",
  305. recipe = "group:tree",
  306. cooktime = 4
  307. })
  308. minetest.register_craft({
  309. type = "fuel",
  310. recipe = "ethereal:charcoal_lump",
  311. burntime = 10
  312. })
  313. -- Make Torch from Charcoal Lump
  314. minetest.register_craft({
  315. output = "default:torch 4",
  316. recipe = {
  317. {"ethereal:charcoal_lump"},
  318. {"default:stick"}
  319. }
  320. })
  321. ethereal.lightstaff_recipes = {
  322. ["nether:rack"] = "nether:glowstone",
  323. ["nether:rack_deep"] = "nether:glowstone_deep"
  324. }
  325. -- Staff of Light (by Xanthin)
  326. minetest.register_tool("ethereal:light_staff", {
  327. description = S("Staff of Light"),
  328. inventory_image = "ethereal_light_staff.png",
  329. light_source = 13, -- used by other mods
  330. wield_image = "ethereal_light_staff.png",
  331. sound = {breaks = "default_tool_breaks"},
  332. stack_max = 1,
  333. on_use = function(itemstack, user, pointed_thing)
  334. if pointed_thing.type ~= "node" then
  335. return
  336. end
  337. local pos = pointed_thing.under
  338. local pname = user:get_player_name()
  339. if minetest.is_protected(pos, pname) then
  340. minetest.record_protection_violation(pos, pname)
  341. return
  342. end
  343. local node = minetest.get_node(pos).name
  344. local def = minetest.registered_nodes[node]
  345. local stone = def and def.groups and def.groups.stone and def.groups.stone == 1
  346. if ethereal.lightstaff_recipes[node] or stone then
  347. local glo = ethereal.lightstaff_recipes[node] or "ethereal:glostone"
  348. minetest.set_node(pos, {name = glo})
  349. itemstack:add_wear(65535 / 149) -- 150 uses
  350. return itemstack
  351. end
  352. end
  353. })
  354. minetest.register_craft({
  355. output = "ethereal:light_staff",
  356. recipe = {
  357. {"ethereal:illumishroom", "default:mese_crystal", "ethereal:illumishroom"},
  358. {"ethereal:illumishroom2", "default:steel_ingot", "ethereal:illumishroom2"},
  359. {"ethereal:illumishroom3", "default:steel_ingot", "ethereal:illumishroom3"}
  360. }
  361. })