Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function flowers.register_large(name, desc, inv_img, bot_img, colr) --change in function
- -- Double Plant Func
- function flowers_double(itemstack, placer, pointed_thing)
- pos.y = pos.y-1
- local name = minetest.get_node(pos).name
- if minetest.get_item_group(name, "soil") ~= 0 then
- pos.y = pos.y+1
- local height = 0
- while minetest.get_node(pos).name == "flowers:"..name.."_bottom" and height < 2 do
- height = height+1
- pos.y = pos.y+1
- end
- if height <2 then
- if minetest.get_node(pos).name == "air" then
- minetest.set_node(pos, {name="flowers:"..name.."_top"})
- end
- end
- end
- end
- -- Bottom
- minetest.register_node("flowers:"..name.."_bottom", {
- description = desc.." Bottom",
- drawtype = "plantlike",
- tiles = { "double_plant_"..name.."_bottom.png" },
- inventory_image = "flowers_"..inv_img..".png",
- wield_image = "flowers_"..inv_img..".png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = false,
- buildable_to = true,
- on_place = flowers_double(itemstack, placer, pointed_thing),
- drop = "flowers:"..name,
- groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,colr=1, drop_by_liquid=1, double_bottom =1},
- sounds = default.node_sound_leaves_defaults(),
- selection_box = {
- type = "fixed",
- fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
- },
- })
- -- Top
- minetest.register_node("flowers:"..name.."_top", {
- description = desc.." Top",
- drawtype = "plantlike",
- tiles = { "double_plant_"..name.."_top.png" },
- inventory_image = "double_plant_"..inv_img.."_top.png",
- wield_image = "double_plant_"..inv_img.."_top.png",
- sunlight_propagates = true,
- paramtype = "light",
- walkable = false,
- buildable_to = true,
- drop = "flowers:"..name,
- groups = {snappy=3,flammable=2,flower=1,flora=1,attached_node=1,colr=1, drop_by_liquid=1, not_in_creative_inventory = 1, double_top =1},
- sounds = default.node_sound_leaves_defaults(),
- selection_box = {
- type = "fixed",
- fixed = { -0.25, -0.5, -0.25, 0.25, 0.5, 0.25 },
- },
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement