compatibility.lua 5.7 KB

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