station_mortar.lua 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. local mortar_table_functions = simplecrafting_lib.generate_table_functions('mortar', {
  2. show_guides = false,
  3. alphabetize_items = true,}
  4. )
  5. local mortar_table_def = {
  6. description = 'Mortar & Pestle',
  7. drawtype = 'mesh',
  8. mesh = 'stations_mortar.obj',
  9. tiles = {'stations_mortar.png', 'stations_pestle.png'},
  10. sounds = default.node_sound_wood_defaults(),
  11. paramtype2 = 'facedir',
  12. paramtype = 'light',
  13. selection_box = {
  14. type = 'fixed',
  15. fixed = {-.4, -.5, -.4, .4, .1, .4},
  16. },
  17. collision_box = {
  18. type = 'fixed',
  19. fixed = {-.4, -.5, -.4, .4, .1, .4},
  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', 'Mortar & Pestle')
  25. end,
  26. }
  27. for k, v in pairs(mortar_table_functions) do
  28. mortar_table_def[k] = v
  29. end
  30. minetest.register_node('stations:mortar', mortar_table_def)
  31. local mortar_locked_functions = simplecrafting_lib.generate_table_functions('mortar', {
  32. show_guides = false,
  33. alphabetize_items = true,}
  34. )
  35. local mortar_locked_def = {
  36. description = 'Mortar & Pestle (locked)',
  37. drawtype = 'mesh',
  38. mesh = 'stations_mortar.obj',
  39. tiles = {'stations_mortar.png', 'stations_pestle.png'},
  40. sounds = default.node_sound_wood_defaults(),
  41. paramtype2 = 'facedir',
  42. paramtype = 'light',
  43. selection_box = {
  44. type = 'fixed',
  45. fixed = {-.4, -.5, -.4, .4, .1, .4},
  46. },
  47. collision_box = {
  48. type = 'fixed',
  49. fixed = {-.4, -.5, -.4, .4, .1, .4},
  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', 'Mortar & Pestle (locked)')
  55. end,
  56. }
  57. for k, v in pairs(mortar_locked_functions) do
  58. mortar_locked_def[k] = v
  59. end
  60. minetest.register_node('stations:mortar_locked', mortar_locked_def)
  61. local is_uninv = minetest.global_exists("unified_inventory") or false
  62. if is_uninv then
  63. unified_inventory.register_craft_type("mortar", {
  64. description = "Mortar & Pestle",
  65. icon = 'stations_mortar_icon.png',
  66. width = 4,
  67. height = 2,
  68. uses_crafting_grid = false
  69. })
  70. end