brewing_stand.lua 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. --brewing stand and level 2 potions
  2. -- GENERATED CODE
  3. -- Node Box Editor, version 0.8.1 - Glass
  4. minetest.register_node("witchcraft:brewing_stand", {
  5. tiles = {
  6. "witchcraft_brewing_stand_top.png",
  7. "witchcraft_brewing_stand_top.png",
  8. "witchcraft_brewing_stand_side.png",
  9. "witchcraft_brewing_stand_side.png",
  10. "witchcraft_brewing_stand_side.png",
  11. "witchcraft_brewing_stand_side.png"
  12. },
  13. drawtype = "nodebox",
  14. use_texture_alpha = true,
  15. paramtype = "light",
  16. drop = {
  17. items = {
  18. {items = {'witchcraft:brewing_stand_unready'}, rarity = 1},
  19. }
  20. },
  21. groups = {cracky=1, oddly_breakable_by_hand=1},
  22. node_box = {
  23. type = "fixed",
  24. fixed = {
  25. {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1
  26. {-0.0625, -0.5, -0.0625, 0.0625, 0, 0.0625}, -- NodeBox2
  27. {-0.5, 0, -0.125, 0.5, 0.0625, 0.125}, -- NodeBox3
  28. {-0.4375, -0.1875, -0.0625, -0.3125, 0.375, 0.0625}, -- NodeBox4
  29. {0.3125, -0.1875, -0.0625, 0.4375, 0.375, 0.0625}, -- NodeBox5
  30. {-0.125, 0.0625, -0.125, 0.125, 0.125, 0.125}, -- NodeBox6
  31. {-0.1875, 0.125, -0.125, 0.1875, 0.375, 0.125}, -- NodeBox7
  32. {-0.125, 0.125, -0.1875, 0.125, 0.375, 0.1875}, -- NodeBox8
  33. {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox9
  34. }
  35. },
  36. on_rightclick = function(pos, node, clicker, item, _)
  37. local wield_item = clicker:get_wielded_item():get_name()
  38. local new_item = wield_item.."_2"
  39. if minetest.get_item_group(wield_item, "potion") ~= 0 then
  40. minetest.set_node(pos, {name="witchcraft:brewing_stand_active", param2=node.param2})
  41. item:take_item()
  42. minetest.after(30, function()
  43. minetest.set_node(pos, {name="witchcraft:brewing_stand_unready", param2=node.param2})
  44. minetest.add_item(pos, new_item)
  45. end)
  46. end
  47. end,
  48. })
  49. minetest.register_node("witchcraft:brewing_stand_active", {
  50. tiles = {
  51. "witchcraft_brewing_stand_top.png",
  52. "witchcraft_brewing_stand_top.png",
  53. "witchcraft_brewing_stand_side.png",
  54. "witchcraft_brewing_stand_side.png",
  55. "witchcraft_brewing_stand_side.png",
  56. "witchcraft_brewing_stand_side.png"
  57. },
  58. drawtype = "nodebox",
  59. use_texture_alpha = true,
  60. paramtype = "light",
  61. light_source = 1,
  62. drop = {
  63. items = {
  64. {items = {'witchcraft:brewing_stand_unready'}, rarity = 1},
  65. }
  66. },
  67. groups = {cracky=1, oddly_breakable_by_hand=1},
  68. node_box = {
  69. type = "fixed",
  70. fixed = {
  71. {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1
  72. {-0.0625, -0.5, -0.0625, 0.0625, 0, 0.0625}, -- NodeBox2
  73. {-0.5, 0, -0.125, 0.5, 0.0625, 0.125}, -- NodeBox3
  74. {-0.4375, -0.1875, -0.0625, -0.3125, 0.375, 0.0625}, -- NodeBox4
  75. {0.3125, -0.1875, -0.0625, 0.4375, 0.375, 0.0625}, -- NodeBox5
  76. {-0.125, 0.0625, -0.125, 0.125, 0.125, 0.125}, -- NodeBox6
  77. {-0.1875, 0.125, -0.125, 0.1875, 0.375, 0.125}, -- NodeBox7
  78. {-0.125, 0.125, -0.1875, 0.125, 0.375, 0.1875}, -- NodeBox8
  79. {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox9
  80. }
  81. }
  82. })
  83. minetest.register_node("witchcraft:brewing_stand_unready", {
  84. description = "brewing stand",
  85. tiles = {
  86. "witchcraft_brewing_stand_top.png^[colorize:black:100",
  87. "witchcraft_brewing_stand_top.png^[colorize:black:100",
  88. "witchcraft_brewing_stand_side.png^[colorize:black:100",
  89. "witchcraft_brewing_stand_side.png^[colorize:black:100",
  90. "witchcraft_brewing_stand_side.png^[colorize:black:100",
  91. "witchcraft_brewing_stand_side.png^[colorize:black:100"
  92. },
  93. inventory_image = "witchcraft_brewing_stand_inv.png",
  94. drawtype = "nodebox",
  95. use_texture_alpha = true,
  96. paramtype = "light",
  97. light_source = 1,
  98. drop = {
  99. items = {
  100. {items = {'witchcraft:brewing_stand_unready'}, rarity = 1},
  101. }
  102. },
  103. groups = {cracky=1, oddly_breakable_by_hand=1},
  104. node_box = {
  105. type = "fixed",
  106. fixed = {
  107. {-0.25, -0.5, -0.25, 0.25, -0.4375, 0.25}, -- NodeBox1
  108. {-0.0625, -0.5, -0.0625, 0.0625, 0, 0.0625}, -- NodeBox2
  109. {-0.5, 0, -0.125, 0.5, 0.0625, 0.125}, -- NodeBox3
  110. {-0.4375, -0.1875, -0.0625, -0.3125, 0.375, 0.0625}, -- NodeBox4
  111. {0.3125, -0.1875, -0.0625, 0.4375, 0.375, 0.0625}, -- NodeBox5
  112. {-0.125, 0.0625, -0.125, 0.125, 0.125, 0.125}, -- NodeBox6
  113. {-0.1875, 0.125, -0.125, 0.1875, 0.375, 0.125}, -- NodeBox7
  114. {-0.125, 0.125, -0.1875, 0.125, 0.375, 0.1875}, -- NodeBox8
  115. {-0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625}, -- NodeBox9
  116. }
  117. },
  118. on_rightclick = function(pos, node, clicker, item, _)
  119. local wield_item = clicker:get_wielded_item():get_name()
  120. if wield_item == "default:mese_crystal_fragment" then
  121. minetest.set_node(pos, {name="witchcraft:brewing_stand", param2=node.param2})
  122. item:take_item()
  123. end
  124. end,
  125. })
  126. --end of GENERATED CODE
  127. minetest.register_abm({
  128. nodenames = {"witchcraft:brewing_stand_active"},
  129. interval = 0.5,
  130. chance = 1,
  131. action = function(pos, node)
  132. minetest.add_particlespawner({
  133. amount = 2,
  134. time = 1,
  135. minpos = {x=pos.x-0.1, y=pos.y, z=pos.z-0.1},
  136. maxpos = {x=pos.x+0.1, y=pos.y, z=pos.z+0.1},
  137. minvel = {x=0, y=0.5, z=0},
  138. maxvel = {x=0, y=0.6, z=0},
  139. minacc = {x=0, y=0.2, z=0},
  140. maxacc = {x=0, y=0.3, z=0},
  141. minexptime = 1,
  142. maxexptime = 2,
  143. minsize = 0.5,
  144. maxsize = 1,
  145. collisiondetection = false,
  146. texture = "witchcraft_smoke.png"
  147. })
  148. end
  149. })
  150. minetest.register_craft({
  151. output = 'witchcraft:brewing_stand_unready',
  152. recipe = {
  153. {'', '', ''},
  154. {'group:stick', 'default:diamond', 'group:stick'},
  155. {'', 'default:obsidian_shard', ''},
  156. }
  157. })