Fix that shop info doesn't show when protected externally

This commit is contained in:
Phoenix616 2021-05-16 00:06:01 +01:00
parent ca25dca6b0
commit c9b8e136d1
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0

View File

@ -66,16 +66,14 @@ public class PlayerInteract implements Listener {
if (Properties.USE_BUILT_IN_PROTECTION && uBlock.couldBeShopContainer(block)) { if (Properties.USE_BUILT_IN_PROTECTION && uBlock.couldBeShopContainer(block)) {
Sign sign = uBlock.getConnectedSign(block); Sign sign = uBlock.getConnectedSign(block);
if (sign != null) { if (sign != null) {
if (Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
return;
}
if (!Security.canAccess(player, block)) { if (!Security.canAccess(player, block, Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY)) {
event.setCancelled(true);
if (Permission.has(player, Permission.SHOPINFO)) { if (Permission.has(player, Permission.SHOPINFO)) {
ChestShop.callEvent(new ShopInfoEvent(player, sign)); ChestShop.callEvent(new ShopInfoEvent(player, sign));
} else { event.setCancelled(true);
} else if (!Properties.TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY) {
Messages.ACCESS_DENIED.send(player); Messages.ACCESS_DENIED.send(player);
event.setCancelled(true);
} }
} }