diff --git a/plugin.yml b/plugin.yml index 9bba6ae..b7d3f0e 100644 --- a/plugin.yml +++ b/plugin.yml @@ -36,4 +36,7 @@ permissions: description: "Allows making 1 chest shop" chestshop.makeshop.unlimited: default: op - description: "Allows making unlimited chest shops" \ No newline at end of file + description: "Allows making unlimited chest shops" + chestshop.deleteshop: + default: op + description: "Allows deleting any chest shop" \ No newline at end of file diff --git a/src/ChestShop/EventListener.php b/src/ChestShop/EventListener.php index 63ae2d7..545ee09 100644 --- a/src/ChestShop/EventListener.php +++ b/src/ChestShop/EventListener.php @@ -115,7 +115,7 @@ public function onPlayerBreakBlock(BlockBreakEvent $event) ]; $shopInfo = $this->databaseManager->selectByCondition($condition); if ($shopInfo !== false) { - if ($shopInfo['shopOwner'] !== $player->getName()) { + if ($shopInfo['shopOwner'] !== $player->getName() and !$player->hasPermission("chestshop.deleteshop")) { $player->sendMessage("This sign has been protected!"); $event->setCancelled(); } else { @@ -133,7 +133,7 @@ public function onPlayerBreakBlock(BlockBreakEvent $event) ]; $shopInfo = $this->databaseManager->selectByCondition($condition); if ($shopInfo !== false) { - if ($shopInfo['shopOwner'] !== $player->getName()) { + if ($shopInfo['shopOwner'] !== $player->getName() and !$player->hasPermission("chestshop.deleteshop")) { $player->sendMessage("This chest has been protected!"); $event->setCancelled(); } else {