From 9d398b1d2e6f7c4a27aeac3b64faeafeb1f5572e Mon Sep 17 00:00:00 2001 From: ementalo Date: Mon, 23 Apr 2012 23:46:53 +0100 Subject: [PATCH] New permission essentials.invsee.preventmodify. People with this permission cannot have their inventories modified by invsee --- .../src/com/earth2me/essentials/EssentialsPlayerListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java index f48138e4d..ef2be0f33 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java @@ -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); }