Allow permitted players to break other players' shops

This commit is contained in:
Eric 2016-11-18 20:31:57 +01:00
parent 58ad504f7f
commit ef3bc57381

View File

@ -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;
}