-- =================================================================== local bushes = { { "fruitless" , "Fruitless" } , { "strawberry" , "Strawberry" } , { "blackberry" , "Blackberry" } , { "blueberry" , "Blueberry" } , { "raspberry" , "Raspberry" } , { "gooseberry" , "Gooseberry" } , { "mixed_berry" , "Mixed Berry" } , } -- =================================================================== local neednode local texture_top = "bushes_bush_top.png" local texture_bottom = "bushes_bush_bottom.png" -- =================================================================== for _, b in ipairs (bushes) do local base, desc = unpack (b) neednode = "bushes:" .. base .. "_bush" if ocutil.node_missing (neednode) then minetest.register_node (":" .. neednode, { description = desc .. " Bush" , drawtype = "nodebox" , tiles = { texture_top , texture_bottom , "bushes_" .. base .. "_bush.png" } , inventory_image = "bushes_" .. base .. "_bush.png" , paramtype = "light" , sunlight_propagates = true , walkable = false , node_box = { type = "fixed" , fixed = { { -1.0/16 , -8/16, -1.0/16, 1.0/16, -6/16, 1.0/16 } , { -4.0/16 , -6/16, -4.0/16, 4.0/16, 5/16, 4.0/16 } , { -5.0/16 , -5/16, -5.0/16, 5.0/16, 3/16, 5.0/16 } , { -6.0/16 , -4/16, -6.0/16, 6.0/16, 2/16, 6.0/16 } , { -6.5/16 , -3/16, -6.5/16, 6.5/16, -2/16, 6.5/16 } , { -3.0/16 , 5/16, -3.0/16, 3.0/16, 6/16, 3.0/16 } , { -2.0/16 , 5/16, -2.0/16, 2.0/16, 7/16, 2.0/16 } , } } , groups = { snappy = 3, bush = 1, flammable = 2, attached_node=1 } , sounds = default.node_sound_leaves_defaults(), }) end neednode = "bushes:basket_" .. base if base ~= "fruitless" and ocutil.node_missing (neednode) then minetest.register_node (":" .. neednode, { description = desc .. " basket" , drawtype = "mesh" , mesh = "bushes_basket_full.obj" , tiles = { "bushes_basket_pie_" .. base .. ".png" , "bushes_basket.png" } , paramtype = "light" , paramtype2 = "facedir" , on_use = minetest.item_eat (18) , groups = { dig_immediate = 3 } , }) end end -- =================================================================== -- End of file.