Skip to content

Commit 29ec26a

Browse files
auouymousnumberZero
authored andcommitted
Prevent unauthorized players from toggling blinky plant.
1 parent 0d86f2c commit 29ec26a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mesecons_blinkyplant/init.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ mesecon.register_node("mesecons_blinkyplant:blinky_plant", {
3232
fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
3333
},
3434
on_timer = on_timer,
35-
on_rightclick = toggle_timer,
35+
on_rightclick = function(pos, node, clicker)
36+
if minetest.is_protected(pos, clicker and clicker:get_player_name()) then
37+
return
38+
end
39+
40+
toggle_timer(pos)
41+
end,
3642
on_construct = toggle_timer
3743
},{
3844
tiles = {"jeija_blinky_plant_off.png"},

0 commit comments

Comments
 (0)