station_anvil.lua 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.png'},
  36. use_texture_alpha = 'opaque',
  37. sounds = default.node_sound_wood_defaults(),
  38. paramtype2 = 'facedir',
  39. paramtype = 'light',
  40. selection_box = {
  41. type = 'fixed',
  42. fixed = {
  43. {1.5, -.5, -.375, -.44, 0, .4},
  44. {1.1, .1, 0, .38, .5, .38},
  45. }
  46. },
  47. collision_box = {
  48. type = 'fixed',
  49. fixed = {
  50. {1.5, -.5, -.375, -.44, 0, .4},
  51. {1.1, .1, 0, .38, .5, .38},
  52. }
  53. },
  54. groups = {oddly_breakable_by_hand = 1, choppy=3},
  55. after_place_node = function(pos, placer, itemstack)
  56. if not epic.space_to_side(pos) then
  57. minetest.remove_node(pos)
  58. return itemstack
  59. end
  60. local meta = minetest.get_meta(pos)
  61. meta:set_string('infotext', 'Smithy Station')
  62. end,
  63. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  64. epic.remove_side_node(pos, oldnode)
  65. end,
  66. on_rotate = function(pos, node)
  67. return false
  68. end,
  69. }
  70. for k, v in pairs(anvil_table_functions) do
  71. --anvil_multifurnace0_def[k] = v
  72. anvil_multifurnace_def[k] = v
  73. end
  74. --minetest.register_node('stations:anvil0', anvil_multifurnace0_def)
  75. minetest.register_node('stations:anvil1', anvil_multifurnace_def)
  76. local anvil_locked_table_functions = simplecrafting_lib.generate_table_functions('anvil', {
  77. show_guides = true,
  78. alphabetize_items = true,
  79. protect_inventory = true,
  80. })
  81. local anvil_locked_multifurnace_def = {
  82. description = 'Smithy Station (locked)',
  83. drawtype = 'mesh',
  84. mesh = 'stations_anvil.obj',
  85. tiles = {'stations_anvil.png'},
  86. use_texture_alpha = 'opaque',
  87. sounds = default.node_sound_wood_defaults(),
  88. paramtype2 = 'facedir',
  89. paramtype = 'light',
  90. selection_box = {
  91. type = 'fixed',
  92. fixed = {
  93. {1.5, -.5, -.375, -.44, 0, .4},
  94. {1.1, .1, 0, .38, .5, .38},
  95. }
  96. },
  97. collision_box = {
  98. type = 'fixed',
  99. fixed = {
  100. {1.5, -.5, -.375, -.44, 0, .4},
  101. {1.1, .1, 0, .38, .5, .38},
  102. }
  103. },
  104. groups = {oddly_breakable_by_hand = 1, choppy=3},
  105. after_place_node = function(pos, placer, itemstack)
  106. if not epic.space_to_side(pos) then
  107. minetest.remove_node(pos)
  108. return itemstack
  109. end
  110. local meta = minetest.get_meta(pos)
  111. meta:set_string('infotext', 'Smithy Station (locked)')
  112. end,
  113. after_dig_node = function(pos, oldnode, oldmetadata, digger)
  114. epic.remove_side_node(pos, oldnode)
  115. end,
  116. on_rotate = function(pos, node)
  117. return false
  118. end,
  119. }
  120. for k, v in pairs(anvil_locked_table_functions) do
  121. anvil_locked_multifurnace_def[k] = v
  122. end
  123. --minetest.register_node('stations:anvil0', anvil_multifurnace0_def)
  124. minetest.register_node('stations:anvil_locked', anvil_locked_multifurnace_def)
  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. })