diff --git a/food.lua b/food.lua index 6f792c1..c4ddb51 100644 --- a/food.lua +++ b/food.lua @@ -29,6 +29,47 @@ minetest.register_node("ethereal:banana", { end, }) +-- Banana Bunch +minetest.register_node("ethereal:banana_bunch", { + description = S("Banana Bunch"), + drawtype = "torchlike", + tiles = {"banana_bunch.png"}, + inventory_image = "banana_bunch.png", + wield_image = "banana_bunch.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.31, -0.5, -0.31, 0.31, 0.5, 0.31} + }, + groups = { + fleshy = 3, dig_immediate = 3, flammable = 2, + leafdecay = 1, leafdecay_drop = 1 + }, + drop = "ethereal:banana_bunch", + on_use = minetest.item_eat(6), + sounds = default.node_sound_leaves_defaults(), + after_place_node = function(pos, placer) + if placer:is_player() then + minetest.set_node(pos, {name = "ethereal:banana_bunch", param2 = 1}) + end + end, +}) + +-- Bunch to Single +minetest.register_craft({ + type = "shapeless", + output = "ethereal:banana 3", + recipe = {"ethereal:banana_bunch"} +}) + +minetest.register_craft({ + type = "shapeless", + output = "ethereal:banana_bunch", + recipe = {"ethereal:banana", "ethereal:banana", "ethereal:banana"} +}) + -- Banana Dough minetest.register_craftitem("ethereal:banana_dough", { description = S("Banana Dough"), diff --git a/sapling.lua b/sapling.lua index 92990c2..69e0201 100644 --- a/sapling.lua +++ b/sapling.lua @@ -87,7 +87,13 @@ function ethereal.grow_big_tree(pos) end function ethereal.grow_banana_tree(pos) - add_tree(pos, 3, 0, 3, ethereal.bananatree) + if math.random(3) == 1 + and minetest.find_node_near(pos, 1, {"farming:soil_wet"}) then + add_tree(pos, 3, 0, 3, ethereal.bananatree, + {{"ethereal:banana", "ethereal:banana_bunch"}}) + else + add_tree(pos, 3, 0, 3, ethereal.bananatree) + end end function ethereal.grow_frost_tree(pos) diff --git a/textures/banana_bunch.png b/textures/banana_bunch.png new file mode 100644 index 0000000..9e73cb6 Binary files /dev/null and b/textures/banana_bunch.png differ