]> git.lizzy.rs Git - worldedit.git/commitdiff
Make inventory++ hide button for players without worldedit priv
authorest31 <MTest31@outlook.com>
Mon, 16 Feb 2015 21:55:09 +0000 (22:55 +0100)
committerest31 <MTest31@outlook.com>
Mon, 16 Feb 2015 22:05:18 +0000 (23:05 +0100)
worldedit_gui/init.lua

index 3088f724766cab40340fd718eacfd5d48b65f08b..afd8c2c20c38e2ac2f272b3804b296ee7fc23f95 100644 (file)
@@ -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