Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

Commit

Permalink
Added permission for chest deletion bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonw4331 committed Jul 13, 2019
1 parent f28ea2d commit b85f350
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ permissions:
description: "Allows making 1 chest shop"
chestshop.makeshop.unlimited:
default: op
description: "Allows making unlimited chest shops"
description: "Allows making unlimited chest shops"
chestshop.deleteshop:
default: op
description: "Allows deleting any chest shop"
4 changes: 2 additions & 2 deletions src/ChestShop/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit b85f350

Please sign in to comment.