init.lua 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. --[[
  2. Original textures from DocFarming mod
  3. https://forum.minetest.net/viewtopic.php?id=3948
  4. ]]
  5. minetest.register_craftitem(":farming:potato_salad", {
  6. description = "Cucumber and Potato Salad",
  7. inventory_image = "farming_potato_salad.png",
  8. on_use = minetest.item_eat(10, "xdecor:bowl"),
  9. })
  10. minetest.register_craft({
  11. output = "farming:potato_salad",
  12. recipe = {
  13. {"cucumber:cucumber"},
  14. {"potatoes:baked_potato"},
  15. {"xdecor:bowl"},
  16. }
  17. })
  18. minetest.register_node("cucumber:seed", {
  19. description = "Cucumber Seed",
  20. tiles = {"farming_cucumber_seed.png"},
  21. wield_image = "farming_cucumber_seed.png",
  22. inventory_image = "farming_cucumber_seed.png",
  23. drawtype = "signlike",
  24. paramtype = "light",
  25. paramtype2 = "wallmounted",
  26. walkable = false,
  27. sunlight_propagates = true,
  28. selection_box = farming.select,
  29. groups = utility.dig_groups("seeds", {seed = 1, attached_node = 1, flammable = 2, notify_destruct = 1}),
  30. on_place = function(itemstack, placer, pointed_thing)
  31. return farming.place_seed(itemstack, placer, pointed_thing, "cucumber:seed")
  32. end,
  33. on_timer = farming.grow_plant,
  34. minlight = 13,
  35. maxlight = default.LIGHT_MAX,
  36. next_plant = "cucumber:cucumber_1",
  37. fertility = {"grassland"},
  38. sounds = default.node_sound_dirt_defaults({
  39. dug = {name = "default_grass_footstep", gain = 0.2},
  40. place = {name = "default_place_node", gain = 0.25},
  41. }),
  42. })
  43. -- cucumber
  44. minetest.register_craftitem("cucumber:cucumber", {
  45. description = "Cucumber",
  46. inventory_image = "farming_cucumber.png",
  47. groups = {food_cucumber = 1, flammable = 2},
  48. on_use = minetest.item_eat(4),
  49. flowerpot_insert = {"cucumber:cucumber_1", "cucumber:cucumber_2", "cucumber:cucumber_3", "cucumber:cucumber_4"},
  50. })
  51. -- cucumber definition
  52. local crop_def = {
  53. drawtype = "plantlike",
  54. tiles = {"farming_cucumber_1.png"},
  55. paramtype = "light",
  56. sunlight_propagates = true,
  57. waving = 1,
  58. walkable = false,
  59. buildable_to = true,
  60. drop = "",
  61. selection_box = farming.select,
  62. groups = utility.dig_groups("crop", {
  63. flammable = 2, plant = 1, attached_node = 1,
  64. not_in_creative_inventory = 1,
  65. }),
  66. sounds = default.node_sound_leaves_defaults(),
  67. on_timer = farming.grow_plant,
  68. minlight = 13,
  69. maxlight = default.LIGHT_MAX,
  70. movement_speed_multiplier = default.SLOW_SPEED_PLANTS,
  71. flowerpot_drop = "cucumber:cucumber",
  72. }
  73. -- stage 1
  74. crop_def.next_plant = "cucumber:cucumber_2"
  75. minetest.register_node("cucumber:cucumber_1", table.copy(crop_def))
  76. -- stage 2
  77. crop_def.next_plant = "cucumber:cucumber_3"
  78. crop_def.tiles = {"farming_cucumber_2.png"}
  79. minetest.register_node("cucumber:cucumber_2", table.copy(crop_def))
  80. -- stage 3
  81. crop_def.next_plant = "cucumber:cucumber_4"
  82. crop_def.tiles = {"farming_cucumber_3.png"}
  83. minetest.register_node("cucumber:cucumber_3", table.copy(crop_def))
  84. -- stage 4 (final)
  85. crop_def.tiles = {"farming_cucumber_4.png"}
  86. crop_def.drop = {
  87. items = {
  88. {items = {'cucumber:seed 1'}, rarity = 1},
  89. {items = {'cucumber:seed 1'}, rarity = 3},
  90. {items = {'cucumber:cucumber'}, rarity = 1},
  91. {items = {'cucumber:cucumber'}, rarity = 3},
  92. }
  93. }
  94. crop_def.next_plant = nil
  95. minetest.register_node("cucumber:cucumber_4", table.copy(crop_def))