melon.lua 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. minetest.register_craftitem("lottfarming:melon_seed", {
  2. description = "Melon Seed",
  3. inventory_image = "lottfarming_melon_seed.png",
  4. on_place = function(itemstack, placer, pointed_thing)
  5. return place_seed(itemstack, placer, pointed_thing, "lottfarming:melon_1")
  6. end,
  7. })
  8. minetest.register_node("lottfarming:melon_1", {
  9. paramtype = "light",
  10. sunlight_propagates = true,
  11. drawtype = "nodebox",
  12. drop = "",
  13. tiles = {"lottfarming_melon_top.png", "lottfarming_melon_top.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png", "lottfarming_melon_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:melon_2", {
  30. paramtype = "light",
  31. sunlight_propagates = true,
  32. drawtype = "nodebox",
  33. drop = "",
  34. tiles = {"lottfarming_melon_top.png", "lottfarming_melon_top.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png", "lottfarming_melon_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:melon_3", {
  51. description = "Melon",
  52. paramtype2 = "facedir",
  53. tiles = {"lottfarming_melon_top.png", "lottfarming_melon_top.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png", "lottfarming_melon_side.png"},
  54. drop = {
  55. max_items = 6,
  56. items = {
  57. { items = {'lottfarming:melon_seed'} },
  58. { items = {'lottfarming:melon_seed'}, rarity = 20},
  59. { items = {'lottfarming:melon 8'} },
  60. }
  61. },
  62. groups = {choppy=2, oddly_breakable_by_hand=1, flammable=2, plant=1},
  63. sounds = default.node_sound_wood_defaults(),
  64. })
  65. minetest.register_alias("lottfarming:melon_slice", "lottfarming:melon")
  66. minetest.register_craftitem("lottfarming:melon", {
  67. description = "Melon",
  68. inventory_image = "lottfarming_melon.png",
  69. on_use = minetest.item_eat(2),
  70. })
  71. farming:add_plant("lottfarming:melon_3", {"lottfarming:melon_1", "lottfarming:melon_2"}, 80, 20)