station_spinning_wheel.lua 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. local spinning_wheel_table_functions = simplecrafting_lib.generate_table_functions('spinning_wheel', {
  2. show_guides = true,
  3. alphabetize_items = true,}
  4. )
  5. local spinning_wheel_table_def = {
  6. description = 'Spinning Wheel',
  7. drawtype = 'mesh',
  8. mesh = 'stations_spinning_wheel.obj',
  9. tiles = {'stations_spinning_wheel.png'},
  10. sounds = default.node_sound_wood_defaults(),
  11. paramtype2 = 'facedir',
  12. paramtype = 'light',
  13. selection_box = {
  14. type = 'fixed',
  15. fixed = {-.5, -.5, -.25, .5, .2, .25},
  16. },
  17. collision_box = {
  18. type = 'fixed',
  19. fixed = {-.5, -.5, -.25, .5, .2, .25},
  20. },
  21. groups = {oddly_breakable_by_hand = 1, choppy=3},
  22. after_place_node = function(pos)
  23. local meta = minetest.get_meta(pos)
  24. meta:set_string('infotext', 'Spinning Wheel')
  25. end,
  26. }
  27. for k, v in pairs(spinning_wheel_table_functions) do
  28. spinning_wheel_table_def[k] = v
  29. end
  30. minetest.register_node('stations:spinning_wheel', spinning_wheel_table_def)
  31. local spinning_wheel_locked_functions = simplecrafting_lib.generate_table_functions('spinning_wheel', {
  32. show_guides = true,
  33. alphabetize_items = true,}
  34. )
  35. local spinning_wheel_locked_def = {
  36. description = 'Spinning Wheel (locked)',
  37. drawtype = 'mesh',
  38. mesh = 'stations_spinning_wheel.obj',
  39. tiles = {'stations_spinning_wheel.png'},
  40. sounds = default.node_sound_wood_defaults(),
  41. paramtype2 = 'facedir',
  42. paramtype = 'light',
  43. selection_box = {
  44. type = 'fixed',
  45. fixed = {-.5, -.5, -.25, .5, .2, .25},
  46. },
  47. collision_box = {
  48. type = 'fixed',
  49. fixed = {-.5, -.5, -.25, .5, .2, .25},
  50. },
  51. groups = {oddly_breakable_by_hand = 1, choppy=3},
  52. after_place_node = function(pos)
  53. local meta = minetest.get_meta(pos)
  54. meta:set_string('infotext', 'Spinning Wheel (Locked)')
  55. end,
  56. }
  57. for k, v in pairs(spinning_wheel_locked_functions) do
  58. spinning_wheel_locked_def[k] = v
  59. end
  60. minetest.register_node('stations:spinning_wheel_locked', spinning_wheel_locked_def)
  61. local is_uninv = minetest.global_exists("unified_inventory") or false
  62. if is_uninv then
  63. unified_inventory.register_craft_type("spinning_wheel", {
  64. description = "Spinning Wheel",
  65. icon = 'stations_spinning_icon.png',
  66. width = 4,
  67. height = 2,
  68. uses_crafting_grid = false
  69. })
  70. end