station_anvil.lua 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. local anvil_table_functions = simplecrafting_lib.generate_table_functions('anvil', {
  2. show_guides = true,
  3. alphabetize_items = true,
  4. --active_node = 'stations:anvil1',
  5. })
  6. --[[local anvil_multifurnace0_def = { --off furnace
  7. description = 'Tool Repair Station',
  8. drawtype = 'mesh',
  9. mesh = 'stations_anvil.obj',
  10. tiles = {'stations_anvil_rust.png', 'stations_anvil_default.png', 'stations_anvil.png'},
  11. sounds = default.node_sound_wood_defaults(),
  12. paramtype2 = 'facedir',
  13. paramtype = 'light',
  14. selection_box = {
  15. type = 'fixed',
  16. fixed = {
  17. {1.5, -.5, -.375, -.44, 0, .4},
  18. {1.1, .1, 0, .38, .5, .38},
  19. }
  20. },
  21. collision_box = {
  22. type = 'fixed',
  23. fixed = {
  24. {1.5, -.5, -.375, -.44, 0, .4},
  25. {1.1, .1, 0, .38, .5, .38},
  26. }
  27. },
  28. groups = {oddly_breakable_by_hand = 1, choppy=3},
  29. }
  30. --]]
  31. local anvil_multifurnace_def = { --on furnace
  32. description = 'Smithy Station',
  33. drawtype = 'mesh',
  34. mesh = 'stations_anvil.obj',
  35. tiles = {'stations_anvil_rust.png', 'stations_anvil_default.png', 'stations_anvil_fire.png'},
  36. sounds = default.node_sound_wood_defaults(),
  37. paramtype2 = 'facedir',
  38. paramtype = 'light',
  39. selection_box = {
  40. type = 'fixed',
  41. fixed = {
  42. {1.5, -.5, -.375, -.44, 0, .4},
  43. {1.1, .1, 0, .38, .5, .38},
  44. }
  45. },
  46. collision_box = {
  47. type = 'fixed',
  48. fixed = {
  49. {1.5, -.5, -.375, -.44, 0, .4},
  50. {1.1, .1, 0, .38, .5, .38},
  51. }
  52. },
  53. groups = {oddly_breakable_by_hand = 1, choppy=3},
  54. after_place_node = function(pos, placer, itemstack)
  55. if not epic.space_to_side(pos) then
  56. minetest.remove_node(pos)
  57. return itemstack
  58. end
  59. local meta = minetest.get_meta(pos)
  60. meta:set_string('infotext', 'Smithy Station')
  61. end,
  62. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  63. epic.remove_side_node(pos, oldnode)
  64. end,
  65. on_rotate = function(pos, node)
  66. return false
  67. end,
  68. }
  69. for k, v in pairs(anvil_table_functions) do
  70. --anvil_multifurnace0_def[k] = v
  71. anvil_multifurnace_def[k] = v
  72. end
  73. --minetest.register_node('stations:anvil0', anvil_multifurnace0_def)
  74. minetest.register_node('stations:anvil1', anvil_multifurnace_def)
  75. local anvil_locked_table_functions = simplecrafting_lib.generate_table_functions('anvil', {
  76. show_guides = true,
  77. alphabetize_items = true,
  78. protect_inventory = true,
  79. })
  80. local anvil_locked_multifurnace_def = {
  81. description = 'Smithy Station (locked)',
  82. drawtype = 'mesh',
  83. mesh = 'stations_anvil.obj',
  84. tiles = {'stations_anvil_rust.png', 'stations_anvil_default.png', 'stations_anvil_fire.png'},
  85. sounds = default.node_sound_wood_defaults(),
  86. paramtype2 = 'facedir',
  87. paramtype = 'light',
  88. selection_box = {
  89. type = 'fixed',
  90. fixed = {
  91. {1.5, -.5, -.375, -.44, 0, .4},
  92. {1.1, .1, 0, .38, .5, .38},
  93. }
  94. },
  95. collision_box = {
  96. type = 'fixed',
  97. fixed = {
  98. {1.5, -.5, -.375, -.44, 0, .4},
  99. {1.1, .1, 0, .38, .5, .38},
  100. }
  101. },
  102. groups = {oddly_breakable_by_hand = 1, choppy=3},
  103. after_place_node = function(pos, placer, itemstack)
  104. if not epic.space_to_side(pos) then
  105. minetest.remove_node(pos)
  106. return itemstack
  107. end
  108. local meta = minetest.get_meta(pos)
  109. meta:set_string('infotext', 'Smithy Station (locked)')
  110. end,
  111. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  112. epic.remove_side_node(pos, oldnode)
  113. end,
  114. on_rotate = function(pos, node)
  115. return false
  116. end,
  117. }
  118. for k, v in pairs(anvil_locked_table_functions) do
  119. anvil_locked_multifurnace_def[k] = v
  120. end
  121. --minetest.register_node('stations:anvil0', anvil_multifurnace0_def)
  122. minetest.register_node('stations:anvil_locked', anvil_locked_multifurnace_def)
  123. local is_uninv = minetest.global_exists("unified_inventory") or false
  124. if is_uninv then
  125. unified_inventory.register_craft_type("anvil", {
  126. description = "Smithy Station",
  127. icon = 'stations_anvil_icon.png',
  128. width = 4,
  129. height = 2,
  130. uses_crafting_grid = false
  131. })
  132. end