compatibility.lua 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. local S = farming.intllib
  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. if minetest.registered_nodes["flowers:mushroom_brown"] then
  13. minetest.override_item("flowers:mushroom_brown", {
  14. light_source = 1,
  15. groups = {food_mushroom = 1, snappy = 3, attached_node = 1, flammable = 2}
  16. })
  17. end
  18. --= Aliases
  19. -- Banana
  20. if eth then
  21. alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling")
  22. alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
  23. alias("farming_plus:banana", "ethereal:banana")
  24. else
  25. minetest.register_node(":ethereal:banana", {
  26. description = S("Banana"),
  27. drawtype = "torchlike",
  28. tiles = {"banana_single.png"},
  29. inventory_image = "banana_single.png",
  30. wield_image = "banana_single.png",
  31. paramtype = "light",
  32. sunlight_propagates = true,
  33. walkable = false,
  34. selection_box = {
  35. type = "fixed",
  36. fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
  37. },
  38. groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
  39. on_use = minetest.item_eat(2),
  40. sounds = default.node_sound_leaves_defaults()
  41. })
  42. minetest.register_node(":ethereal:bananaleaves", {
  43. description = S("Banana Leaves"),
  44. tiles = {"banana_leaf.png"},
  45. inventory_image = "banana_leaf.png",
  46. wield_image = "banana_leaf.png",
  47. paramtype = "light",
  48. waving = 1,
  49. groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
  50. sounds = default.node_sound_leaves_defaults()
  51. })
  52. alias("farming_plus:banana_sapling", "default:sapling")
  53. alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
  54. alias("farming_plus:banana", "ethereal:banana")
  55. end
  56. -- Carrot
  57. alias("farming_plus:carrot_seed", "farming:carrot")
  58. alias("farming_plus:carrot_1", "farming:carrot_1")
  59. alias("farming_plus:carrot_2", "farming:carrot_4")
  60. alias("farming_plus:carrot_3", "farming:carrot_6")
  61. alias("farming_plus:carrot", "farming:carrot_8")
  62. alias("farming_plus:carrot_item", "farming:carrot")
  63. -- Cocoa
  64. alias("farming_plus:cocoa_sapling", "farming:cocoa_beans")
  65. alias("farming_plus:cocoa_leaves", "default:leaves")
  66. alias("farming_plus:cocoa", "default:apple")
  67. alias("farming_plus:cocoa_bean", "farming:cocoa_beans")
  68. -- Orange
  69. alias("farming_plus:orange_1", "farming:tomato_1")
  70. alias("farming_plus:orange_2", "farming:tomato_4")
  71. alias("farming_plus:orange_3", "farming:tomato_6")
  72. if eth then
  73. alias("farming_plus:orange_item", "ethereal:orange")
  74. alias("farming_plus:orange", "ethereal:orange")
  75. alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling")
  76. else
  77. minetest.register_node(":ethereal:orange", {
  78. description = S("Orange"),
  79. drawtype = "plantlike",
  80. tiles = {"farming_orange.png"},
  81. inventory_image = "farming_orange.png",
  82. wield_image = "farming_orange.png",
  83. paramtype = "light",
  84. sunlight_propagates = true,
  85. walkable = false,
  86. selection_box = {
  87. type = "fixed",
  88. fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2}
  89. },
  90. groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
  91. on_use = minetest.item_eat(4),
  92. sounds = default.node_sound_leaves_defaults()
  93. })
  94. alias("farming_plus:orange_item", "ethereal:orange")
  95. alias("farming_plus:orange", "ethereal:orange")
  96. alias("farming_plus:orange_seed", "default:sapling")
  97. end
  98. -- Potato
  99. alias("farming_plus:potato_item", "farming:potato")
  100. alias("farming_plus:potato_1", "farming:potato_1")
  101. alias("farming_plus:potato_2", "farming:potato_2")
  102. alias("farming_plus:potato", "farming:potato_3")
  103. alias("farming_plus:potato_seed", "farming:potato")
  104. -- Pumpkin
  105. alias("farming:pumpkin_seed", "farming:pumpkin_slice")
  106. alias("farming:pumpkin_face", "farming:jackolantern")
  107. alias("farming:pumpkin_face_light", "farming:jackolantern_on")
  108. alias("farming:big_pumpkin", "farming:jackolantern")
  109. alias("farming:big_pumpkin_side", "air")
  110. alias("farming:big_pumpkin_top", "air")
  111. alias("farming:big_pumpkin_corner", "air")
  112. alias("farming:scarecrow", "farming:jackolantern")
  113. alias("farming:scarecrow_light", "farming:jackolantern_on")
  114. alias("farming:pumpkin_flour", "farming:pumpkin_dough")
  115. -- Rhubarb
  116. alias("farming_plus:rhubarb_seed", "farming:rhubarb")
  117. alias("farming_plus:rhubarb_1", "farming:rhubarb_1")
  118. alias("farming_plus:rhubarb_2", "farming:rhubarb_2")
  119. alias("farming_plus:rhubarb", "farming:rhubarb_3")
  120. alias("farming_plus:rhubarb_item", "farming:rhubarb")
  121. -- Strawberry
  122. if eth then
  123. alias("farming_plus:strawberry_item", "ethereal:strawberry")
  124. alias("farming_plus:strawberry_seed", "ethereal:strawberry")
  125. alias("farming_plus:strawberry_1", "ethereal:strawberry_1")
  126. alias("farming_plus:strawberry_2", "ethereal:strawberry_3")
  127. alias("farming_plus:strawberry_3", "ethereal:strawberry_5")
  128. alias("farming_plus:strawberry", "ethereal:strawberry_7")
  129. else
  130. minetest.register_craftitem(":ethereal:strawberry", {
  131. description = S("Strawberry"),
  132. inventory_image = "strawberry.png",
  133. wield_image = "strawberry.png",
  134. groups = {food_strawberry = 1, flammable = 2},
  135. on_use = minetest.item_eat(1)
  136. })
  137. alias("farming_plus:strawberry_item", "ethereal:strawberry")
  138. alias("farming_plus:strawberry_seed", "ethereal:strawberry")
  139. alias("farming_plus:strawberry_1", "farming:raspberry_1")
  140. alias("farming_plus:strawberry_2", "farming:raspberry_2")
  141. alias("farming_plus:strawberry_3", "farming:raspberry_3")
  142. alias("farming_plus:strawberry", "farming:raspberry_4")
  143. end
  144. -- Tomato
  145. alias("farming_plus:tomato_seed", "farming:tomato")
  146. alias("farming_plus:tomato_item", "farming:tomato")
  147. alias("farming_plus:tomato_1", "farming:tomato_2")
  148. alias("farming_plus:tomato_2", "farming:tomato_4")
  149. alias("farming_plus:tomato_3", "farming:tomato_6")
  150. alias("farming_plus:tomato", "farming:tomato_8")
  151. -- Weed
  152. alias("farming:weed", "default:grass_2")