Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for name,def in pairs(mindeca.melon) do
- minetest.register_node("mindeca:fruit_"..def.elonname, {
- description = def.elondesc.."\n\nMindeca",
- tiles = {
- "mindeca_fruit_"..def.elonname.."_top.png",
- "mindeca_fruit_"..def.elonname.."_bot.png",
- "mindeca_fruit_"..def.elonname..".png"
- },
- groups = {snappy = 3, flammable = 2, melon = 1},
- drop = "mindeca:fruit_"..def.elonname,
- sounds = default.node_sound_leaves_defaults()
- })
- minetest.register_node("mindeca:vine_"..def.elonname, {
- description = def.vinedesc.."\n\nMindeca",
- tiles = {
- "mindeca_vine_"..def.elonname..".png"
- },
- paramtype = "light",
- paramtype2 = "facedir",
- groups = {snappy = 3, flammable = 2, melon = 1},
- drop = "mindeca:fruit_"..def.elonname,
- node_placement_prediction = "mindeca:vine_"..def.elonname,
- after_place_node = function(pos, placer, itemstack, pointed_thing)
- minetest.get_node_timer(pos):start(math.random(5, 5))
- end,
- on_timer = function(pos, elapsed)
- if not mindeca.can_grow_fullsun(pos) then
- minetest.get_node_timer(pos):start(math.random(5, 5))
- end
- return
- local melrot = minetest.get_node(pos).param2
- if melrot = 0 then
- minetest.set_node(
- {x = pos.x-1, y = pos.y, z = pos.z},
- {name = "mindeca:fruit_"..def.elonname}
- )
- elseif melrot = 1 then
- minetest.set_node(
- {x = pos.x, y = pos.y, z = pos.z},
- {name = "mindeca:fruit_"..def.elonname}
- )
- elseif melrot = 2 then
- minetest.set_node(
- {x = pos.x, y = pos.y, z = pos.z},
- {name = "mindeca:fruit_"..def.elonname}
- )
- elseif melrot = 3 then
- minetest.set_node(
- {x = pos.x, y = pos.y, z = pos.z},
- {name = "mindeca:fruit_"..def.elonname}
- )
- elseif melrot = nil then return
- end
- end
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement