-- Waterlily
--
-minetest.register_node("flowers:waterlily", {
+local waterlily_def = {
description = "Waterlily",
drawtype = "nodebox",
paramtype = "light",
local pos = pointed_thing.above
local node = minetest.get_node(pointed_thing.under)
local def = minetest.registered_nodes[node.name]
- local player_name = placer and placer:get_player_name() or ""
if def and def.on_rightclick then
return def.on_rightclick(pointed_thing.under, node, placer, itemstack,
if def and def.liquidtype == "source" and
minetest.get_item_group(node.name, "water") > 0 then
+ local player_name = placer and placer:get_player_name() or ""
if not minetest.is_protected(pos, player_name) then
- minetest.set_node(pos, {name = "flowers:waterlily",
+ minetest.set_node(pos, {name = "flowers:waterlily" ..
+ (def.waving == 3 and "_waving" or ""),
param2 = math.random(0, 3)})
if not (creative and creative.is_enabled_for
and creative.is_enabled_for(player_name)) then
return itemstack
end
-})
+}
+
+local waterlily_waving_def = table.copy(waterlily_def)
+waterlily_waving_def.waving = 3
+waterlily_waving_def.drop = "flowers:waterlily"
+waterlily_waving_def.groups.not_in_creative_inventory = 1
+
+minetest.register_node("flowers:waterlily", waterlily_def)
+minetest.register_node("flowers:waterlily_waving", waterlily_waving_def)
+
},
y_max = 0,
y_min = 0,
- decoration = "flowers:waterlily",
+ decoration = "flowers:waterlily_waving",
param2 = 0,
param2_max = 3,
place_offset_y = 1,
biomes = {"rainforest_swamp", "savanna_shore", "deciduous_forest_shore"},
y_max = 0,
y_min = 0,
- decoration = "flowers:waterlily",
+ decoration = "flowers:waterlily_waving",
param2 = 0,
param2_max = 3,
place_offset_y = 1,