cabbage.lua 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. minetest.register_craftitem("lottfarming:cabbage_seed", {
  2. description = "Cabbage Seed",
  3. inventory_image = "lottfarming_cabbage_seed.png",
  4. on_place = function(itemstack, placer, pointed_thing)
  5. return place_seed(itemstack, placer, pointed_thing, "lottfarming:cabbage_1")
  6. end,
  7. })
  8. minetest.register_node("lottfarming:cabbage_1", {
  9. paramtype = "light",
  10. sunlight_propagates = true,
  11. drawtype = "nodebox",
  12. drop = "",
  13. tiles = {"lottfarming_cabbage_top.png", "lottfarming_cabbage_top.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png"},
  14. node_box = {
  15. type = "fixed",
  16. fixed = {
  17. {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
  18. },
  19. },
  20. selection_box = {
  21. type = "fixed",
  22. fixed = {
  23. {-0.2, -0.5, -0.2, 0.2, -0.1, 0.2}
  24. },
  25. },
  26. groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, not_in_creative_inventory=1, plant=1},
  27. sounds = default.node_sound_wood_defaults(),
  28. })
  29. minetest.register_node("lottfarming:cabbage_2", {
  30. paramtype = "light",
  31. sunlight_propagates = true,
  32. drawtype = "nodebox",
  33. drop = "",
  34. tiles = {"lottfarming_cabbage_top.png", "lottfarming_cabbage_top.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png"},
  35. node_box = {
  36. type = "fixed",
  37. fixed = {
  38. {-0.35, -0.5, -0.35, 0.35, 0.2, 0.35}
  39. },
  40. },
  41. selection_box = {
  42. type = "fixed",
  43. fixed = {
  44. {-0.35, -0.5, -0.35, 0.35, 0.2, 0.35}
  45. },
  46. },
  47. groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, not_in_creative_inventory=1, plant=1},
  48. sounds = default.node_sound_wood_defaults(),
  49. })
  50. minetest.register_node("lottfarming:cabbage_3", {
  51. description = "Cabbage",
  52. paramtype2 = "facedir",
  53. tiles = {"lottfarming_cabbage_top.png", "lottfarming_cabbage_top.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png"},
  54. drop = {
  55. max_items = 6,
  56. items = {
  57. { items = {'lottfarming:cabbage_seed'} },
  58. { items = {'lottfarming:cabbage_seed'}, rarity = 2},
  59. { items = {'lottfarming:cabbage_seed'}, rarity = 5},
  60. { items = {'lottfarming:cabbage'} },
  61. { items = {'lottfarming:cabbage'}, rarity = 2 },
  62. { items = {'lottfarming:cabbage'}, rarity = 5 }
  63. }
  64. },
  65. groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, plant=1},
  66. sounds = default.node_sound_wood_defaults(),
  67. })
  68. minetest.register_node("lottfarming:cabbage", {
  69. description = "Cabbage",
  70. paramtype2 = "facedir",
  71. tiles = {"lottfarming_cabbage_top.png", "lottfarming_cabbage_top.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png", "lottfarming_cabbage_side.png"},
  72. groups = {choppy=2, oddly_breakable_by_hand=2, flammable=2, plant=1, salad=1},
  73. sounds = default.node_sound_wood_defaults(),
  74. on_use = minetest.item_eat(4)
  75. })
  76. farming:add_plant("lottfarming:cabbage_3", {"lottfarming:cabbage_1", "lottfarming:cabbage_2"}, 80, 20)
  77. minetest.register_craft({
  78. output = 'lottfarming:salad',
  79. recipe = {
  80. {'group:salad', 'group:salad', 'group:salad'},
  81. {'', 'lottfarming:bowl', ''},
  82. }
  83. })
  84. minetest.register_craftitem("lottfarming:salad", {
  85. description = "Salad",
  86. inventory_image = "lottfarming_salad.png",
  87. on_use = minetest.item_eat(10),
  88. })