New permission essentials.invsee.preventmodify. People with this permission cannot have their inventories modified by invsee

This commit is contained in:
ementalo 2012-04-23 23:46:53 +01:00
parent caeb3279cb
commit 9d398b1d2e

View File

@ -421,7 +421,9 @@ public class EssentialsPlayerListener implements Listener
if (event.getView().getTopInventory().getType() == InventoryType.PLAYER)
{
final User user = ess.getUser(event.getWhoClicked());
if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify"))
final User invOwner = ess.getUser(event.getView().getPlayer());
if (user.isInvSee() && !user.isAuthorized("essentials.invsee.modify")
|| invOwner.isAuthorized("essentials.invsee.preventmodify"))
{
event.setCancelled(true);
}