potato.lua 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. minetest.register_craftitem("lottfarming:potato_seed", {
  2. description = "Potato Seeds",
  3. inventory_image = "lottfarming_potato_seed.png",
  4. on_place = function(itemstack, placer, pointed_thing)
  5. return place_seed(itemstack, placer, pointed_thing, "lottfarming:potato_1", 40)
  6. end,
  7. })
  8. minetest.register_node("lottfarming:potato_1", {
  9. paramtype = "light",
  10. paramtype2 = "meshoptions",
  11. walkable = false,
  12. drawtype = "plantlike",
  13. drop = "",
  14. tiles = {"lottfarming_potato_1.png"},
  15. waving = 1,
  16. selection_box = {
  17. type = "fixed",
  18. fixed = {
  19. {-0.5, -0.5, -0.5, 0.5, -0.5+6/16, 0.5}
  20. },
  21. },
  22. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  23. sounds = default.node_sound_leaves_defaults(),
  24. })
  25. minetest.register_node("lottfarming:potato_2", {
  26. paramtype = "light",
  27. paramtype2 = "meshoptions",
  28. walkable = false,
  29. drawtype = "plantlike",
  30. drop = "",
  31. tiles = {"lottfarming_potato_2.png"},
  32. waving = 1,
  33. selection_box = {
  34. type = "fixed",
  35. fixed = {
  36. {-0.5, -0.5, -0.5, 0.5, -0.5+9/16, 0.5}
  37. },
  38. },
  39. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  40. sounds = default.node_sound_leaves_defaults(),
  41. })
  42. minetest.register_node("lottfarming:potato_3", {
  43. paramtype = "light",
  44. paramtype2 = "meshoptions",
  45. walkable = false,
  46. drawtype = "plantlike",
  47. tiles = {"lottfarming_potato_3.png"},
  48. waving = 1,
  49. drop = {
  50. max_items = 6,
  51. items = {
  52. { items = {'lottfarming:potato_seed'} },
  53. { items = {'lottfarming:potato_seed'}, rarity = 2},
  54. { items = {'lottfarming:potato_seed'}, rarity = 5},
  55. { items = {'lottfarming:potato'} },
  56. { items = {'lottfarming:potato'}, rarity = 2 },
  57. { items = {'lottfarming:potato'}, rarity = 5 }
  58. }
  59. },
  60. groups = {snappy=3, flammable=2, not_in_creative_inventory=1,plant=1},
  61. sounds = default.node_sound_leaves_defaults(),
  62. })
  63. minetest.register_craftitem("lottfarming:potato", {
  64. description = "Potato",
  65. inventory_image = "lottfarming_potato.png",
  66. on_use = minetest.item_eat(1),
  67. })
  68. farming:add_plant("lottfarming:potato_3", {"lottfarming:potato_1", "lottfarming:potato_2"}, 50, 20, 40)
  69. minetest.register_craft({
  70. type = "cooking",
  71. cooktime = 15,
  72. output = "lottfarming:potato_cooked",
  73. recipe = "lottfarming:potato"
  74. })
  75. minetest.register_craftitem("lottfarming:potato_cooked", {
  76. description = "Cooked Potato",
  77. inventory_image = "lottfarming_potato_cooked.png",
  78. on_use = minetest.item_eat(5),
  79. })