[nalc_flowers] Corrige callback on_place du lily_pad
This commit is contained in:
parent
98968a54cd
commit
61176e5bf0
@ -8,20 +8,20 @@ lilypad_def.on_place = function(itemstack, placer, pointed_thing)
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
|
||||
if def and def.on_rightclick then
|
||||
return def.on_rightclick(pointed_thing.under, node, placer, itemstack,
|
||||
pointed_thing)
|
||||
end
|
||||
|
||||
if def and def.liquidtype == "source" and
|
||||
if def then
|
||||
if def.on_rightclick then
|
||||
def.on_rightclick(pointed_thing.under, node, placer, itemstack, pointed_thing)
|
||||
elseif 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 = "nalc_flowers:lily_pad" ..
|
||||
(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
|
||||
minetest.set_node(
|
||||
pos, {
|
||||
name = "nalc_flowers:lily_pad" ..(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
|
||||
itemstack:take_item()
|
||||
end
|
||||
else
|
||||
@ -29,7 +29,7 @@ lilypad_def.on_place = function(itemstack, placer, pointed_thing)
|
||||
minetest.record_protection_violation(pos, player_name)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user