diff options
author | Anthony Zhang <azhang9@gmail.com> | 2015-02-16 19:58:59 -0500 |
---|---|---|
committer | Anthony Zhang <azhang9@gmail.com> | 2015-02-16 19:58:59 -0500 |
commit | 4336e7ca1467599feb08c1f9ad0aaa145c080ca8 (patch) | |
tree | 9821b4469d6603aeaa7612035ce04718b5cd4dca | |
parent | b0fbcf197ffc0c635933294776e26ee50033440d (diff) | |
parent | eca54f0851aa49a7ef7941936c9cf6dba4bfe7ec (diff) |
Merge pull request #73 from est31/hidebutton
Make inventory++ hide button for players without worldedit priv
-rw-r--r-- | worldedit_gui/init.lua | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua index 3088f72..afd8c2c 100644 --- a/worldedit_gui/init.lua +++ b/worldedit_gui/init.lua @@ -102,7 +102,10 @@ if unified_inventory then --unified inventory installed end elseif inventory_plus then --inventory++ installed minetest.register_on_joinplayer(function(player) - inventory_plus.register_button(player, "worldedit_gui", "WorldEdit") + local can_worldedit = minetest.check_player_privs(player:get_player_name(), {worldedit=true}) + if can_worldedit then + inventory_plus.register_button(player, "worldedit_gui", "WorldEdit") + end end) --show the form when the button is pressed and hide it when done |