extra.lua 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355
  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 4",
  100. recipe = {
  101. {"farming:cotton", "farming:cotton"},
  102. {"farming:cotton", "farming:cotton"},
  103. {"farming:cotton", "farming:cotton"},
  104. }
  105. })
  106. -- Palm Wax
  107. minetest.register_craftitem("ethereal:palm_wax", {
  108. description = S("Palm Wax"),
  109. inventory_image = "palm_wax.png",
  110. wield_image = "palm_wax.png",
  111. })
  112. minetest.register_craft({
  113. type = "cooking",
  114. cooktime = 10,
  115. output = "ethereal:palm_wax",
  116. recipe = "ethereal:palmleaves"
  117. })
  118. -- Candle from Wax and String/Cotton
  119. minetest.register_node("ethereal:candle", {
  120. description = S("Candle"),
  121. drawtype = "plantlike",
  122. inventory_image = "candle_static.png",
  123. wield_image = "candle_static.png",
  124. tiles = {
  125. {
  126. name = "candle.png",
  127. animation={
  128. type="vertical_frames",
  129. aspect_w = 32,
  130. aspect_h = 32,
  131. length = 1.0
  132. }
  133. },
  134. },
  135. paramtype = "light",
  136. light_source = 11,
  137. sunlight_propagates = true,
  138. walkable = false,
  139. groups = {dig_immediate = 3, attached_node = 1},
  140. sounds = default.node_sound_defaults(),
  141. selection_box = {
  142. type = "fixed",
  143. fixed = { -0.15, -0.5, -0.15, 0.15, 0, 0.15 }
  144. },
  145. })
  146. minetest.register_craft({
  147. output = "ethereal:candle 2",
  148. recipe = {
  149. {"farming:string"},
  150. {"ethereal:palm_wax"},
  151. {"ethereal:palm_wax"},
  152. }
  153. })
  154. -- Wooden Bowl
  155. minetest.register_craftitem("ethereal:bowl", {
  156. description = S("Bowl"),
  157. inventory_image = "bowl.png",
  158. groups = {food_bowl = 1, flammable = 2},
  159. })
  160. -- use farming redo's recipe if found
  161. if not minetest.registered_items["farming:bowl"] then
  162. minetest.register_craft({
  163. output = "ethereal:bowl 4",
  164. recipe = {
  165. {"group:wood", "", "group:wood"},
  166. {"", "group:wood", ""},
  167. }
  168. })
  169. end
  170. -- stone Ladder
  171. minetest.register_node("ethereal:stone_ladder", {
  172. description = S("Stone Ladder"),
  173. drawtype = "signlike",
  174. tiles = {"stone_ladder.png"},
  175. inventory_image = "stone_ladder.png",
  176. wield_image = "stone_ladder.png",
  177. paramtype = "light",
  178. sunlight_propagates = true,
  179. paramtype2 = "wallmounted",
  180. walkable = false,
  181. climbable = true,
  182. is_ground_content = false,
  183. selection_box = {
  184. type = "wallmounted",
  185. },
  186. groups = {cracky = 3, oddly_breakable_by_hand = 1},
  187. legacy_wallmounted = true,
  188. sounds = default.node_sound_stone_defaults(),
  189. })
  190. minetest.register_craft({
  191. output = "ethereal:stone_ladder 4",
  192. recipe = {
  193. {"group:stone", "", "group:stone"},
  194. {"group:stone", "group:stone", "group:stone"},
  195. {"group:stone", "", "group:stone"},
  196. }
  197. })
  198. -- Paper Wall
  199. minetest.register_node("ethereal:paper_wall", {
  200. drawtype = "nodebox",
  201. description = S("Paper Wall"),
  202. tiles = {"paper_wall.png"},
  203. inventory_image_image = "paper_wall.png",
  204. wield_image = "paper_wall.png",
  205. paramtype = "light",
  206. groups = {snappy = 3},
  207. sounds = default.node_sound_wood_defaults(),
  208. walkable = true,
  209. is_ground_content = false,
  210. sunlight_propagates = true,
  211. paramtype2 = "facedir",
  212. selection_box = {
  213. type = "fixed",
  214. fixed = { -0.5, -0.5, 5/11, 0.5, 0.5, 8/16 }
  215. },
  216. node_box = {
  217. type = "fixed",
  218. fixed = {
  219. { -0.5, -0.5, 5/11, 0.5, 0.5, 8/16 }
  220. }
  221. },
  222. })
  223. minetest.register_craft({
  224. output = "ethereal:paper_wall",
  225. recipe = {
  226. {"group:stick", "default:paper", "group:stick"},
  227. {"group:stick", "default:paper", "group:stick"},
  228. {"group:stick", "default:paper", "group:stick"},
  229. }
  230. })
  231. -- Glostone (A little bit of light decoration)
  232. minetest.register_node("ethereal:glostone", {
  233. description = S("Glo Stone"),
  234. tiles = {"glostone.png"},
  235. groups = {cracky = 3},
  236. light_source = 13,
  237. drop = "ethereal:glostone",
  238. sounds = default.node_sound_stone_defaults(),
  239. })
  240. minetest.register_craft({
  241. type = "shapeless",
  242. output = "ethereal:glostone",
  243. recipe = {"default:torch", "default:stone", "dye:yellow"}
  244. })
  245. -- Charcoal Lump
  246. minetest.register_craftitem("ethereal:charcoal_lump", {
  247. description = S("Lump of Charcoal"),
  248. inventory_image = "charcoal_lump.png",
  249. })
  250. minetest.register_craft({
  251. output = "ethereal:charcoal_lump 2",
  252. recipe = {
  253. {"ethereal:scorched_tree"}
  254. }
  255. })
  256. minetest.register_craft({
  257. output = "ethereal:charcoal_lump 2",
  258. type = "cooking",
  259. recipe = "group:tree",
  260. cooktime = 4
  261. })
  262. minetest.register_craft({
  263. type = "fuel",
  264. recipe = "ethereal:charcoal_lump",
  265. burntime = 10,
  266. })
  267. -- Make Torch from Charcoal Lump
  268. minetest.register_craft({
  269. output = "default:torch 4",
  270. recipe = {
  271. {"ethereal:charcoal_lump"},
  272. {"default:stick"},
  273. }
  274. })
  275. -- Staff of Light (by Xanthin)
  276. minetest.register_tool("ethereal:light_staff", {
  277. description = S("Staff of Light"),
  278. inventory_image = "light_staff.png",
  279. wield_image = "light_staff.png",
  280. sound = {breaks = "default_tool_breaks"},
  281. stack_max = 1,
  282. on_use = function(itemstack, user, pointed_thing)
  283. if pointed_thing.type ~= "node" then
  284. return
  285. end
  286. local pos = pointed_thing.under
  287. local pname = user:get_player_name()
  288. if minetest.is_protected(pos, pname) then
  289. minetest.record_protection_violation(pos, pname)
  290. return
  291. end
  292. local node = minetest.get_node(pos).name
  293. if node == "default:stone"
  294. or node == "default:desert_stone" then
  295. minetest.swap_node(pos, {name = "ethereal:glostone"})
  296. if not ethereal.check_creative(user:get_player_name()) then
  297. itemstack:add_wear(65535 / 149) -- 150 uses
  298. end
  299. return itemstack
  300. end
  301. end,
  302. })
  303. minetest.register_craft({
  304. output = "ethereal:light_staff",
  305. recipe = {
  306. {"ethereal:illumishroom", "default:mese_crystal", "ethereal:illumishroom"},
  307. {"ethereal:illumishroom2", "default:steel_ingot", "ethereal:illumishroom2"},
  308. {"ethereal:illumishroom3", "default:steel_ingot", "ethereal:illumishroom3"}
  309. }
  310. })