From ef3bc57381573b0387a781933acf4067717b5dad Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 18 Nov 2016 20:31:57 +0100 Subject: [PATCH] Allow permitted players to break other players' shops --- .../de/epiceric/shopchest/listeners/ChestProtectListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java b/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java index ea5d50a..198129c 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ChestProtectListener.java @@ -43,7 +43,7 @@ public class ChestProtectListener implements Listener { Player p = e.getPlayer(); if (p.isSneaking()) { - if (shop.getVendor().getUniqueId().equals(p.getUniqueId())) { + if (shop.getVendor().getUniqueId().equals(p.getUniqueId()) || p.hasPermission("shopchest.removeOther")) { shopUtils.removeShop(shop, true); if (shop.getInventoryHolder() instanceof DoubleChest) { @@ -67,7 +67,7 @@ public class ChestProtectListener implements Listener { return; } - plugin.debug(p.getName() + " broke his shop (#" + shop.getID() + ")"); + plugin.debug(String.format("%s broke %s's shop (#%d)", p.getName(), shop.getVendor().getName(), shop.getID())); p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.SHOP_REMOVED)); return; }