Flowers: Add waterlily and add to mapgen

master
paramat 2015-09-16 02:38:58 +01:00
parent b6c12010b1
commit 4bb9652c0f
5 changed files with 89 additions and 6 deletions

View File

@ -17,6 +17,7 @@ WTFPL
Gambit (WTFPL):
flowers_mushroom_*.png
flowers_waterlily.png
DanDuncombe (WTFPL):
flowers_spores_*.png

View File

@ -236,3 +236,39 @@ minetest.register_abm({
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
})

View File

@ -10,7 +10,7 @@ local function register_mgv6_flower(name)
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
@ -29,7 +29,7 @@ local function register_mgv6_mushroom(name)
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
@ -42,6 +42,26 @@ local function register_mgv6_mushroom(name)
})
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")
@ -52,6 +72,8 @@ function flowers.register_mgv6_decorations()
register_mgv6_mushroom("mushroom_fertile_brown")
register_mgv6_mushroom("mushroom_fertile_red")
register_mgv6_waterlily()
end
@ -67,7 +89,7 @@ local function register_flower(seed, name)
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
@ -92,7 +114,7 @@ local function register_mushroom(name)
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
@ -104,6 +126,28 @@ local function register_mushroom(name)
})
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")
@ -114,6 +158,8 @@ function flowers.register_decorations()
register_mushroom("mushroom_fertile_brown")
register_mushroom("mushroom_fertile_red")
register_waterlily()
end

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB