From 7fc0d08ffc2dfedbb730de40d36d680e47eb4a01 Mon Sep 17 00:00:00 2001 From: ementalo Date: Mon, 23 Apr 2012 23:46:53 +0100 Subject: New permission essentials.invsee.preventmodify. People with this permission cannot have their inventories modified by invsee --- Essentials/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); } -- cgit v1.2.3