Skip to content

Commit 4336e7c

Browse files
committedFeb 17, 2015
Merge pull request #73 from est31/hidebutton
Make inventory++ hide button for players without worldedit priv
2 parents b0fbcf1 + eca54f0 commit 4336e7c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

Diff for: ‎worldedit_gui/init.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ if unified_inventory then --unified inventory installed
102102
end
103103
elseif inventory_plus then --inventory++ installed
104104
minetest.register_on_joinplayer(function(player)
105-
inventory_plus.register_button(player, "worldedit_gui", "WorldEdit")
105+
local can_worldedit = minetest.check_player_privs(player:get_player_name(), {worldedit=true})
106+
if can_worldedit then
107+
inventory_plus.register_button(player, "worldedit_gui", "WorldEdit")
108+
end
106109
end)
107110

108111
--show the form when the button is pressed and hide it when done

0 commit comments

Comments
 (0)