extra.lua 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  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. -- Bamboo Flooring
  17. minetest.register_node("ethereal:bamboo_floor", {
  18. description = S("Bamboo Floor"),
  19. drawtype = "nodebox",
  20. tiles = { "bamboo_floor.png" },
  21. wield_image = "bamboo_floor.png",
  22. inventory_image = "bamboo_floor.png",
  23. paramtype = "light",
  24. paramtype2 = "wallmounted",
  25. walkable = true,
  26. node_box = {
  27. type = "wallmounted",
  28. wall_top = {-0.5, 0.4375, -0.5, 0.5, 0.5, 0.5},
  29. wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
  30. wall_side = {-0.5, -0.5, -0.5, -0.4375, 0.5, 0.5},
  31. },
  32. selection_box = {type = "wallmounted"},
  33. groups = {snappy = 3, choppy = 3 , flammable = 2},
  34. sounds = default.node_sound_wood_defaults(),
  35. })
  36. -- Craft Bamboo into Bamboo Flooring
  37. minetest.register_craft({
  38. output = "ethereal:bamboo_floor 2",
  39. recipe = {
  40. {"ethereal:bamboo", "ethereal:bamboo"},
  41. {"ethereal:bamboo", "ethereal:bamboo"},
  42. }
  43. })
  44. minetest.register_craft({
  45. output = "ethereal:bamboo_block",
  46. recipe = {
  47. {"ethereal:bamboo_floor"},
  48. {"ethereal:bamboo_floor"},
  49. }
  50. })
  51. -- Bamboo Block
  52. minetest.register_node("ethereal:bamboo_block", {
  53. description = S("Bamboo Block"),
  54. tiles = { "bamboo_floor.png" },
  55. paramtype = "light",
  56. groups = {snappy = 3, choppy = 3 , flammable = 2, wood = 1},
  57. sounds = default.node_sound_wood_defaults(),
  58. })
  59. minetest.register_craft({
  60. output = "ethereal:bamboo_block",
  61. recipe = {
  62. {"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
  63. {"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
  64. {"ethereal:bamboo", "ethereal:bamboo", "ethereal:bamboo"},
  65. }
  66. })
  67. -- Craft Bamboo into Paper
  68. minetest.register_craft({
  69. output = "default:paper 6",
  70. recipe = {
  71. {"ethereal:bamboo", "ethereal:bamboo"},
  72. {"ethereal:bamboo", "ethereal:bamboo"},
  73. {"ethereal:bamboo", "ethereal:bamboo"},
  74. }
  75. })
  76. if ethereal.xcraft == true then
  77. -- X pattern craft recipes (5x 'a' in X pattern gives 5 of 'b')
  78. local cheat = {
  79. {"default:cobble", "default:gravel", 5},
  80. {"default:gravel", "default:dirt", 5},
  81. {"default:dirt", "default:sand", 5},
  82. {"default:ice", "default:snow", 20},
  83. {"ethereal:dry_dirt", "default:desert_sand", 5},
  84. {"default:stone", "default:silver_sandstone", 5}
  85. }
  86. for n = 1, #cheat do
  87. minetest.register_craft({
  88. output = cheat[n][2] .. " " .. cheat[n][3],
  89. recipe = {
  90. {cheat[n][1], "", cheat[n][1]},
  91. {"", cheat[n][1], ""},
  92. {cheat[n][1], "", cheat[n][1]},
  93. }
  94. })
  95. end
  96. end -- END if
  97. -- Paper (2x3 string = 4 paper)
  98. minetest.register_craft({
  99. output = "default:paper 2",
  100. recipe = {
  101. {"farming:cotton", "farming:cotton", "farming:cotton"}
  102. }
  103. })
  104. -- Palm Wax
  105. minetest.register_craftitem("ethereal:palm_wax", {
  106. description = S("Palm Wax"),
  107. inventory_image = "palm_wax.png",
  108. wield_image = "palm_wax.png",
  109. })
  110. minetest.register_craft({
  111. type = "cooking",
  112. cooktime = 10,
  113. output = "ethereal:palm_wax",
  114. recipe = "ethereal:palmleaves"
  115. })
  116. -- Candle from Wax and String/Cotton
  117. minetest.register_node("ethereal:candle", {
  118. description = S("Candle"),
  119. drawtype = "plantlike",
  120. inventory_image = "candle_static.png",
  121. wield_image = "candle_static.png",
  122. tiles = {
  123. {
  124. name = "candle.png",
  125. animation={
  126. type="vertical_frames",
  127. aspect_w = 32,
  128. aspect_h = 32,
  129. length = 1.0
  130. }
  131. },
  132. },
  133. paramtype = "light",
  134. light_source = 11,
  135. sunlight_propagates = true,
  136. walkable = false,
  137. groups = {dig_immediate = 3, attached_node = 1},
  138. sounds = default.node_sound_defaults(),
  139. selection_box = {
  140. type = "fixed",
  141. fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
  142. },
  143. })
  144. minetest.register_craft({
  145. output = "ethereal:candle 2",
  146. recipe = {
  147. {"farming:string"},
  148. {"ethereal:palm_wax"},
  149. {"ethereal:palm_wax"},
  150. }
  151. })
  152. -- Wooden Bowl
  153. minetest.register_craftitem("ethereal:bowl", {
  154. description = S("Bowl"),
  155. inventory_image = "bowl.png",
  156. groups = {food_bowl = 1, flammable = 2},
  157. })
  158. -- use farming redo's recipe if found
  159. if not minetest.registered_items["farming:bowl"] then
  160. minetest.register_craft({
  161. output = "ethereal:bowl 4",
  162. recipe = {
  163. {"group:wood", "", "group:wood"},
  164. {"", "group:wood", ""},
  165. }
  166. })
  167. end
  168. -- stone Ladder
  169. minetest.register_node("ethereal:stone_ladder", {
  170. description = S("Stone Ladder"),
  171. drawtype = "signlike",
  172. tiles = {"stone_ladder.png"},
  173. inventory_image = "stone_ladder.png",
  174. wield_image = "stone_ladder.png",
  175. paramtype = "light",
  176. sunlight_propagates = true,
  177. paramtype2 = "wallmounted",
  178. walkable = false,
  179. climbable = true,
  180. is_ground_content = false,
  181. selection_box = {
  182. type = "wallmounted",
  183. },
  184. groups = {cracky = 3, oddly_breakable_by_hand = 1},
  185. legacy_wallmounted = true,
  186. sounds = default.node_sound_stone_defaults(),
  187. })
  188. minetest.register_craft({
  189. output = "ethereal:stone_ladder 4",
  190. recipe = {
  191. {"group:stone", "", "group:stone"},
  192. {"group:stone", "group:stone", "group:stone"},
  193. {"group:stone", "", "group:stone"},
  194. }
  195. })
  196. -- Paper Wall
  197. minetest.register_node("ethereal:paper_wall", {
  198. drawtype = "nodebox",
  199. description = S("Paper Wall"),
  200. tiles = {"paper_wall.png"},
  201. inventory_image_image = "paper_wall.png",
  202. wield_image = "paper_wall.png",
  203. paramtype = "light",
  204. groups = {snappy = 3},
  205. sounds = default.node_sound_wood_defaults(),
  206. walkable = true,
  207. is_ground_content = false,
  208. sunlight_propagates = true,
  209. paramtype2 = "facedir",
  210. selection_box = {
  211. type = "fixed",
  212. fixed = { -0.5, -0.5, 5/11, 0.5, 0.5, 8/16 }
  213. },
  214. node_box = {
  215. type = "fixed",
  216. fixed = {
  217. { -0.5, -0.5, 5/11, 0.5, 0.5, 8/16 }
  218. }
  219. },
  220. })
  221. minetest.register_craft({
  222. output = "ethereal:paper_wall",
  223. recipe = {
  224. {"group:stick", "default:paper", "group:stick"},
  225. {"group:stick", "default:paper", "group:stick"},
  226. {"group:stick", "default:paper", "group:stick"},
  227. }
  228. })
  229. -- Glostone (A little bit of light decoration)
  230. minetest.register_node("ethereal:glostone", {
  231. description = S("Glo Stone"),
  232. tiles = {"glostone.png"},
  233. groups = {cracky = 3},
  234. light_source = 13,
  235. drop = "ethereal:glostone",
  236. sounds = default.node_sound_stone_defaults(),
  237. })
  238. minetest.register_craft({
  239. type = "shapeless",
  240. output = "ethereal:glostone",
  241. recipe = {"default:torch", "default:stone", "dye:yellow"}
  242. })
  243. -- Charcoal Lump
  244. minetest.register_craftitem("ethereal:charcoal_lump", {
  245. description = S("Lump of Charcoal"),
  246. inventory_image = "charcoal_lump.png",
  247. })
  248. minetest.register_craft({
  249. output = "ethereal:charcoal_lump 2",
  250. recipe = {
  251. {"ethereal:scorched_tree"}
  252. }
  253. })
  254. minetest.register_craft({
  255. output = "ethereal:charcoal_lump 2",
  256. type = "cooking",
  257. recipe = "group:tree",
  258. cooktime = 4
  259. })
  260. minetest.register_craft({
  261. type = "fuel",
  262. recipe = "ethereal:charcoal_lump",
  263. burntime = 10,
  264. })
  265. -- Make Torch from Charcoal Lump
  266. minetest.register_craft({
  267. output = "default:torch 4",
  268. recipe = {
  269. {"ethereal:charcoal_lump"},
  270. {"default:stick"},
  271. }
  272. })
  273. -- Staff of Light (by Xanthin)
  274. minetest.register_tool("ethereal:light_staff", {
  275. description = S("Staff of Light"),
  276. inventory_image = "light_staff.png",
  277. wield_image = "light_staff.png",
  278. sound = {breaks = "default_tool_breaks"},
  279. stack_max = 1,
  280. on_use = function(itemstack, user, pointed_thing)
  281. if pointed_thing.type ~= "node" then
  282. return
  283. end
  284. local pos = pointed_thing.under
  285. local pname = user:get_player_name()
  286. if minetest.is_protected(pos, pname) then
  287. minetest.record_protection_violation(pos, pname)
  288. return
  289. end
  290. local node = minetest.get_node(pos).name
  291. if node == "default:stone"
  292. or node == "default:desert_stone" then
  293. minetest.swap_node(pos, {name = "ethereal:glostone"})
  294. if not ethereal.check_creative(user:get_player_name()) then
  295. itemstack:add_wear(65535 / 149) -- 150 uses
  296. end
  297. return itemstack
  298. end
  299. end,
  300. })
  301. minetest.register_craft({
  302. output = "ethereal:light_staff",
  303. recipe = {
  304. {"ethereal:illumishroom", "default:mese_crystal", "ethereal:illumishroom"},
  305. {"ethereal:illumishroom2", "default:steel_ingot", "ethereal:illumishroom2"},
  306. {"ethereal:illumishroom3", "default:steel_ingot", "ethereal:illumishroom3"}
  307. }
  308. })