mirror of
https://github.com/amalthea-mc/ShopChest.git
synced 2024-11-10 04:31:06 +00:00
Allow permitted players to break other players' shops
This commit is contained in:
parent
58ad504f7f
commit
ef3bc57381
@ -43,7 +43,7 @@ public class ChestProtectListener implements Listener {
|
|||||||
Player p = e.getPlayer();
|
Player p = e.getPlayer();
|
||||||
|
|
||||||
if (p.isSneaking()) {
|
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);
|
shopUtils.removeShop(shop, true);
|
||||||
|
|
||||||
if (shop.getInventoryHolder() instanceof DoubleChest) {
|
if (shop.getInventoryHolder() instanceof DoubleChest) {
|
||||||
@ -67,7 +67,7 @@ public class ChestProtectListener implements Listener {
|
|||||||
return;
|
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));
|
p.sendMessage(LanguageUtils.getMessage(LocalizedMessage.Message.SHOP_REMOVED));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user