shell.lua 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. local modname = minetest.get_current_modname()
  2. minetest.register_craftitem(modname..":refractory_clay_lump", {
  3. description = "Refractory Clay",
  4. inventory_image = "default_clay_lump.png^[colorize:white:120",
  5. })
  6. minetest.register_craftitem(modname..":refractory_clay_brick", {
  7. description = "Refractory Brick",
  8. inventory_image = "default_clay_brick.png^[colorize:white:120",
  9. })
  10. minetest.register_node(modname..":refractory_brick", {
  11. description = "Refractory Brick",
  12. tiles = { "default_brick.png^[colorize:white:120" },
  13. is_ground_content = true,
  14. groups = {cracky=1, level=1, refractory=3},
  15. sounds = default.node_sound_stone_defaults(),
  16. })
  17. minetest.register_node(modname..":furnace_heater", {
  18. description = "Furnace Heater",
  19. tiles = { "default_brick.png^[colorize:blue:120" },
  20. is_ground_content = true,
  21. groups = {cracky=1, level=1, refractory=3},
  22. sounds = default.node_sound_stone_defaults(),
  23. })
  24. minetest.register_craft({
  25. output = modname..":refractory_clay_lump 6",
  26. type = "shapeless",
  27. recipe = {
  28. 'default:desert_sand',
  29. 'default:sand',
  30. 'default:clay_lump',
  31. 'default:clay_lump',
  32. 'default:clay_lump',
  33. 'default:clay_lump',
  34. }
  35. })
  36. minetest.register_craft({
  37. output = modname..":refractory_clay_lump 4",
  38. type = "shapeless",
  39. recipe = {
  40. modname..':slag',
  41. modname..':slag',
  42. 'default:clay_lump',
  43. 'default:clay_lump',
  44. }
  45. })
  46. minetest.register_craft({
  47. output = modname..":furnace_heater 1",
  48. type = "shapeless",
  49. recipe = {
  50. 'default:furnace',
  51. modname..":refractory_clay_brick",
  52. modname..":refractory_clay_brick",
  53. modname..":refractory_clay_brick",
  54. modname..":refractory_clay_brick",
  55. }
  56. })
  57. minetest.register_craft({
  58. type = "cooking",
  59. output = modname..":refractory_clay_brick",
  60. recipe = modname..":refractory_clay_lump",
  61. })
  62. minetest.register_craft({
  63. output = modname..':refractory_brick',
  64. recipe = {
  65. {modname..":refractory_clay_brick", modname..":refractory_clay_brick"},
  66. {modname..":refractory_clay_brick", modname..":refractory_clay_brick"},
  67. }
  68. })
  69. minetest.register_node("forge:mold", {
  70. description = "Ingot Mold",
  71. tiles = {
  72. "default_silver_sand.png^(forge_ingots.png^[colorize:black:200)", "default_silver_sand.png",
  73. "default_silver_sand.png", "default_silver_sand.png",
  74. "default_silver_sand.png", "default_silver_sand.png"
  75. },
  76. use_texture_alpha = "blend",
  77. groups = {crumbly=3, refractory=1, falling_node=1},
  78. is_ground_content = false,
  79. sounds = default.node_sound_stone_defaults(),
  80. })
  81. --[[
  82. minetest.register_node(mn..":crucible_spout", {
  83. description = "Crucible Spout",
  84. drawtype="nodebox",
  85. tiles = { "default_stone.png" },
  86. is_ground_content = true,
  87. groups = {cracky=3, stone=1, refractory=3},
  88. paramtype = "light",
  89. sounds = default.node_sound_stone_defaults(),
  90. node_box = {
  91. type = "fixed",
  92. fixed = {
  93. {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
  94. {-.4, -1.0 , -0.4, 0.4, -0.5, 0.4},
  95. {-.3, -1.25, -0.3, 0.3, -1.0, 0.3},
  96. {-.2, -1.5 , -0.2, 0.2, -1.25, 0.2},
  97. },
  98. },
  99. on_punch = function (pos, node)
  100. spoutPour(pos)
  101. end
  102. })
  103. local function spoutPour(pos)
  104. local ore_nodes = minetest.find_nodes_in_area(
  105. {x=pos.x - 2, y=pos.y , z=pos.z - 2},
  106. {x=pos.x + 2, y=pos.y + 4, z=pos.z + 2},
  107. modname..":molten_ore"
  108. )
  109. if ore_nodes == nil then
  110. return
  111. end
  112. local i = 0
  113. local tmp = {}
  114. for _,p in ipairs(ore_nodes) do
  115. i = i + 1
  116. table.insert(tmp, p)
  117. if i >= 4 then
  118. for _,p2 in ipairs(tmp) do
  119. minetest.set_node(p2, {name=modname..":molten_slag"})
  120. end
  121. minetest.set_node({x=pos.x, y=pos.y - 2, z=pos.z}, {name=modname..":hot_steelblock"})
  122. nodeupdate({x=pos.x, y=pos.y - 2, z=pos.z} )
  123. i = 0
  124. tmp = {}
  125. return
  126. end
  127. end
  128. end
  129. ]]