compatibility.lua 5.9 KB

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