Skip to content

Commit

Permalink
Separates permission for removing others' shops, closes wargamer#112
Browse files Browse the repository at this point in the history
  • Loading branch information
weaves7 committed May 2, 2021
1 parent 76dcd3d commit 699bb55
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>org.makershaven</groupId>
<artifactId>SignShop</artifactId>
<version>3.5.1-dev</version>
<version>3.5.2-dev</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private Boolean canDestroy(Player player, Block bBlock) {
SignShopPlayer ssPlayer = new SignShopPlayer(player);
if(itemUtil.clickedSign(bBlock)) {
Seller seller = Storage.get().getSeller(bBlock.getLocation());
return seller == null || seller.isOwner(ssPlayer) || SignShopPlayer.isOp(player) || !SignShopConfig.getEnableShopOwnerProtection();
return seller == null || seller.isOwner(ssPlayer) || SignShopPlayer.isOp(player) || ssPlayer.hasPerm("Signshop.Destroy.Others", true)|| !SignShopConfig.getEnableShopOwnerProtection();
}
return true;
}
Expand Down Expand Up @@ -130,7 +130,7 @@ public void onSSDestroyEvent(SSDestroyedEvent event) {
&& (player.getItemInHand() == null || player.getItemInHand().getType() != SignShopConfig.getDestroyMaterial())) {
event.setCancelled(true);

if(event.getShop().isOwner(player) || event.getPlayer().isOp()) {
if(event.getShop().isOwner(player) || event.getPlayer().isOp() || player.hasPerm("Signshop.Destroy.Others", true)) {
Map<String, String> temp = new LinkedHashMap<>();
temp.put("!destroymaterial", signshopUtil.capFirstLetter(SignShopConfig.getDestroyMaterial().name().toLowerCase()));

Expand Down

0 comments on commit 699bb55

Please sign in to comment.