Fix issues with shop sign opening and access permissions (Fixes #207)

This commit is contained in:
Phoenix616 2019-03-07 17:33:47 +01:00
parent 6d99210dd7
commit de5b505ec5

View File

@ -103,19 +103,18 @@ public class PlayerInteract implements Listener {
return; return;
} }
if (ChestShopSign.hasPermission(player, OTHER_NAME_ACCESS, sign) && !ChestShopSign.isAdminShop(sign)) { if (ChestShopSign.hasPermission(player, OTHER_NAME_ACCESS, sign) && !ChestShopSign.isAdminShop(sign)) {
if (Properties.ALLOW_SIGN_CHEST_OPEN) { if (Properties.ALLOW_SIGN_CHEST_OPEN && !(Properties.IGNORE_CREATIVE_MODE && player.getGameMode() == GameMode.CREATIVE)) {
if (player.isSneaking() || player.isInsideVehicle() if (player.isSneaking() || player.isInsideVehicle()
|| (Properties.IGNORE_CREATIVE_MODE && player.getGameMode() == GameMode.CREATIVE) || (Properties.ALLOW_LEFT_CLICK_DESTROYING && action == LEFT_CLICK_BLOCK && ChestShopSign.hasPermission(player, OTHER_NAME_DESTROY, sign))) {
|| (Properties.ALLOW_LEFT_CLICK_DESTROYING && action == LEFT_CLICK_BLOCK
&& ChestShopSign.hasPermission(player, OTHER_NAME_DESTROY, sign))) {
return; return;
} }
event.setCancelled(true); event.setCancelled(true);
showChestGUI(player, block, sign); showChestGUI(player, block, sign);
return; return;
} else if (Properties.IGNORE_ACCESS_PERMS || ChestShopSign.isOwner(player, sign)) { }
if (Properties.IGNORE_ACCESS_PERMS || ChestShopSign.isOwner(player, sign)) {
// don't allow owners or people with access to buy/sell at this shop // don't allow owners or people with access to buy/sell at this shop
return; return;
} }