diff options
author | auouymous <au@qzx.com> | 2020-12-03 19:12:41 -0700 |
---|---|---|
committer | Vitaliy <numzer0@yandex.ru> | 2020-12-19 23:11:20 +0300 |
commit | 29ec26a4c851d76e4a2ca21949bff94fe37eeccd (patch) | |
tree | b9a2085f0512f5d3f2568dc57f0d5e8462017e7b | |
parent | 0d86f2c45eee3382e59652fce678d9c39a677d77 (diff) | |
download | mesecons-29ec26a4c851d76e4a2ca21949bff94fe37eeccd.tar mesecons-29ec26a4c851d76e4a2ca21949bff94fe37eeccd.tar.gz mesecons-29ec26a4c851d76e4a2ca21949bff94fe37eeccd.tar.bz2 mesecons-29ec26a4c851d76e4a2ca21949bff94fe37eeccd.tar.xz mesecons-29ec26a4c851d76e4a2ca21949bff94fe37eeccd.zip |
Prevent unauthorized players from toggling blinky plant.
-rw-r--r-- | mesecons_blinkyplant/init.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mesecons_blinkyplant/init.lua b/mesecons_blinkyplant/init.lua index 14a274f..3bad6a7 100644 --- a/mesecons_blinkyplant/init.lua +++ b/mesecons_blinkyplant/init.lua @@ -32,7 +32,13 @@ mesecon.register_node("mesecons_blinkyplant:blinky_plant", { fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3}, }, on_timer = on_timer, - on_rightclick = toggle_timer, + on_rightclick = function(pos, node, clicker) + if minetest.is_protected(pos, clicker and clicker:get_player_name()) then + return + end + + toggle_timer(pos) + end, on_construct = toggle_timer },{ tiles = {"jeija_blinky_plant_off.png"}, |