end
end
})
+
+
+--
+-- Waterlily
+--
+
+minetest.register_node("flowers:waterlily", {
+ description = "Waterlily",
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ tiles = {"flowers_waterlily.png"},
+ inventory_image = "flowers_waterlily.png",
+ wield_image = "flowers_waterlily.png",
+ liquids_pointable = true,
+ groups = {snappy = 3},
+ sounds = default.node_sound_leaves_defaults(),
+ node_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, -0.46875, 0.5}
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5}
+ },
+
+ after_place_node = function(pos, placer, itemstack, pointed_thing)
+ local find_water = minetest.find_nodes_in_area({x = pos.x - 1, y = pos.y, z = pos.z - 1},
+ {x = pos.x + 1, y = pos.y, z = pos.z + 1}, "default:water_source")
+ if #find_water ~= 0 then
+ minetest.set_node(pos, {name = "default:water_source"})
+ pos.y = pos.y + 1
+ end
+ minetest.set_node(pos, {name = "flowers:waterlily", param2 = math.random(0, 3)})
+ end
+})
noise_params = {
offset = 0,
scale = 0.006,
- spread = {x=100, y=100, z=100},
+ spread = {x = 100, y = 100, z = 100},
seed = 436,
octaves = 3,
persist = 0.6
noise_params = {
offset = 0,
scale = 0.04,
- spread = {x=100, y=100, z=100},
+ spread = {x = 100, y = 100, z = 100},
seed = 7133,
octaves = 3,
persist = 0.6
})
end
+local function register_mgv6_waterlily()
+ minetest.register_decoration({
+ deco_type = "schematic",
+ place_on = {"default:dirt"},
+ sidelen = 16,
+ noise_params = {
+ offset = -0.12,
+ scale = 0.3,
+ spread = {x = 100, y = 100, z = 100},
+ seed = 33,
+ octaves = 3,
+ persist = 0.7
+ },
+ y_min = 0,
+ y_max = 0,
+ schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts",
+ rotation = "random",
+ })
+end
+
function flowers.register_mgv6_decorations()
register_mgv6_flower("rose")
register_mgv6_flower("tulip")
register_mgv6_mushroom("mushroom_fertile_brown")
register_mgv6_mushroom("mushroom_fertile_red")
+
+ register_mgv6_waterlily()
end
noise_params = {
offset = -0.02,
scale = 0.03,
- spread = {x=200, y=200, z=200},
+ spread = {x = 200, y = 200, z = 200},
seed = seed,
octaves = 3,
persist = 0.6
noise_params = {
offset = 0,
scale = 0.006,
- spread = {x=200, y=200, z=200},
+ spread = {x = 200, y = 200, z = 200},
seed = 2,
octaves = 3,
persist = 0.66
})
end
+local function register_waterlily()
+ minetest.register_decoration({
+ deco_type = "schematic",
+ place_on = {"default:dirt", "default:sand"},
+ sidelen = 16,
+ noise_params = {
+ offset = -0.12,
+ scale = 0.3,
+ spread = {x = 200, y = 200, z = 200},
+ seed = 33,
+ octaves = 3,
+ persist = 0.7
+ },
+ biomes = {"deciduous_forest_ocean", "sandstone_grassland_ocean",
+ "rainforest_swamp", "savanna_ocean", "desert_ocean"},
+ y_min = 0,
+ y_max = 0,
+ schematic = minetest.get_modpath("flowers").."/schematics/waterlily.mts",
+ rotation = "random",
+ })
+end
+
function flowers.register_decorations()
register_flower(436, "rose")
register_flower(19822, "tulip")
register_mushroom("mushroom_fertile_brown")
register_mushroom("mushroom_fertile_red")
+
+ register_waterlily()
end