1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-29 21:30:26 +02:00

Flowers: Add waterlily and add to mapgen

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

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
})