Skip to content

Commit eca54f0

Browse files
committedFeb 16, 2015
Make inventory++ hide button for players without worldedit priv
1 parent b0fbcf1 commit eca54f0

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)
Please sign in to comment.