compatibility.lua 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. local S = farming.translate
  2. --= Helpers
  3. local eth = minetest.get_modpath("ethereal")
  4. local alias = function(orig, new)
  5. minetest.register_alias(orig, new)
  6. end
  7. --= Overrides (add food_* group to apple and brown mushroom)
  8. minetest.override_item("default:apple", {
  9. groups = {food_apple = 1, fleshy = 3, dig_immediate = 3, flammable = 2,
  10. leafdecay = 3, leafdecay_drop = 1}
  11. })
  12. --= Aliases
  13. -- Banana
  14. if eth then
  15. alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling")
  16. alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
  17. alias("farming_plus:banana", "ethereal:banana")
  18. else
  19. minetest.register_node(":ethereal:banana", {
  20. description = S("Banana"),
  21. drawtype = "torchlike",
  22. tiles = {"farming_banana_single.png"},
  23. inventory_image = "farming_banana_single.png",
  24. wield_image = "farming_banana_single.png",
  25. paramtype = "light",
  26. sunlight_propagates = true,
  27. walkable = false,
  28. selection_box = {
  29. type = "fixed",
  30. fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
  31. },
  32. groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
  33. on_use = minetest.item_eat(2),
  34. sounds = default.node_sound_leaves_defaults()
  35. })
  36. minetest.register_node(":ethereal:bananaleaves", {
  37. description = S("Banana Leaves"),
  38. tiles = {"farming_banana_leaf.png"},
  39. inventory_image = "farming_banana_leaf.png",
  40. wield_image = "farming_banana_leaf.png",
  41. paramtype = "light",
  42. waving = 1,
  43. groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
  44. sounds = default.node_sound_leaves_defaults()
  45. })
  46. alias("farming_plus:banana_sapling", "default:sapling")
  47. alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
  48. alias("farming_plus:banana", "ethereal:banana")
  49. end
  50. -- Carrot
  51. alias("farming_plus:carrot_seed", "farming:carrot")
  52. alias("farming_plus:carrot_1", "farming:carrot_1")
  53. alias("farming_plus:carrot_2", "farming:carrot_4")
  54. alias("farming_plus:carrot_3", "farming:carrot_6")
  55. alias("farming_plus:carrot", "farming:carrot_8")
  56. alias("farming_plus:carrot_item", "farming:carrot")
  57. -- Cocoa
  58. alias("farming_plus:cocoa_sapling", "farming:cocoa_beans")
  59. alias("farming_plus:cocoa_leaves", "default:leaves")
  60. alias("farming_plus:cocoa", "default:apple")
  61. alias("farming_plus:cocoa_bean", "farming:cocoa_beans")
  62. -- Orange
  63. alias("farming_plus:orange_1", "farming:tomato_1")
  64. alias("farming_plus:orange_2", "farming:tomato_4")
  65. alias("farming_plus:orange_3", "farming:tomato_6")
  66. if eth then
  67. alias("farming_plus:orange_item", "ethereal:orange")
  68. alias("farming_plus:orange", "ethereal:orange")
  69. alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling")
  70. else
  71. minetest.register_node(":ethereal:orange", {
  72. description = S("Orange"),
  73. drawtype = "plantlike",
  74. tiles = {"farming_orange.png"},
  75. inventory_image = "farming_orange.png",
  76. wield_image = "farming_orange.png",
  77. paramtype = "light",
  78. sunlight_propagates = true,
  79. walkable = false,
  80. selection_box = {
  81. type = "fixed",
  82. fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2}
  83. },
  84. groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
  85. on_use = minetest.item_eat(4),
  86. sounds = default.node_sound_leaves_defaults()
  87. })
  88. alias("farming_plus:orange_item", "ethereal:orange")
  89. alias("farming_plus:orange", "ethereal:orange")
  90. alias("farming_plus:orange_seed", "default:sapling")
  91. end
  92. -- Potato
  93. alias("farming_plus:potato_item", "farming:potato")
  94. alias("farming_plus:potato_1", "farming:potato_1")
  95. alias("farming_plus:potato_2", "farming:potato_2")
  96. alias("farming_plus:potato", "farming:potato_3")
  97. alias("farming_plus:potato_seed", "farming:potato")
  98. -- Pumpkin
  99. alias("farming:pumpkin_seed", "farming:pumpkin_slice")
  100. alias("farming:pumpkin_face", "farming:jackolantern")
  101. alias("farming:pumpkin_face_light", "farming:jackolantern_on")
  102. alias("farming:big_pumpkin", "farming:jackolantern")
  103. alias("farming:big_pumpkin_side", "air")
  104. alias("farming:big_pumpkin_top", "air")
  105. alias("farming:big_pumpkin_corner", "air")
  106. alias("farming:scarecrow", "farming:jackolantern")
  107. alias("farming:scarecrow_light", "farming:jackolantern_on")
  108. alias("farming:pumpkin_flour", "farming:pumpkin_dough")
  109. -- Rhubarb
  110. alias("farming_plus:rhubarb_seed", "farming:rhubarb")
  111. alias("farming_plus:rhubarb_1", "farming:rhubarb_1")
  112. alias("farming_plus:rhubarb_2", "farming:rhubarb_2")
  113. alias("farming_plus:rhubarb", "farming:rhubarb_3")
  114. alias("farming_plus:rhubarb_item", "farming:rhubarb")
  115. -- Strawberry
  116. alias("farming_plus:strawberry_item", "ethereal:strawberry")
  117. alias("farming_plus:strawberry_seed", "ethereal:strawberry")
  118. alias("farming_plus:strawberry_1", "ethereal:strawberry_1")
  119. alias("farming_plus:strawberry_2", "ethereal:strawberry_3")
  120. alias("farming_plus:strawberry_3", "ethereal:strawberry_5")
  121. alias("farming_plus:strawberry", "ethereal:strawberry_7")
  122. -- Tomato
  123. alias("farming_plus:tomato_seed", "farming:tomato")
  124. alias("farming_plus:tomato_item", "farming:tomato")
  125. alias("farming_plus:tomato_1", "farming:tomato_2")
  126. alias("farming_plus:tomato_2", "farming:tomato_4")
  127. alias("farming_plus:tomato_3", "farming:tomato_6")
  128. alias("farming_plus:tomato", "farming:tomato_8")
  129. -- Weed
  130. alias("farming:weed", "default:grass_2")