forked from mtcontrib/plantlife_modpack
respect protection when placing twigs
This commit is contained in:
parent
9963e588d6
commit
622016713e
|
@ -42,6 +42,14 @@ for i in pairs(NoDe) do
|
|||
liquids_pointable = true,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local pt = pointed_thing
|
||||
|
||||
if not placer then return end
|
||||
local playername = placer:get_player_name()
|
||||
if minetest.is_protected(pt.above, playername) then
|
||||
minetest.record_protection_violation(pt.above, playername)
|
||||
return
|
||||
end
|
||||
|
||||
local direction = minetest.dir_to_facedir(placer:get_look_dir())
|
||||
if minetest.get_node(pt.above).name=="air" then
|
||||
minetest.swap_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction})
|
||||
|
|
Loading…
Reference in New Issue
Block a user