Skip to content

Commit

Permalink
only show accessors if there are any
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Jan 13, 2024
1 parent 94e5fbb commit 453938c
Showing 1 changed file with 15 additions and 10 deletions.
Expand Up @@ -135,25 +135,29 @@ private static void showShopInfo(Player player, Sign sign) {
}

ChestShopMetaData chestShopMetaData = ChestShopSign.getChestShopMetaData(sign);
if (chestShopMetaData == null)
if (chestShopMetaData == null) {
return;
}

ItemStack item = chestShopMetaData.getItemStack();

if (Properties.SHOW_SHOP_INFORMATION_ON_SHIFT_CLICK) {
if (!chestShopMetaData.isAdminshop()) {

if (chestShopMetaData.isOwner(player) || Permission.has(player, Permission.MOD)) {
player.sendMessage(Messages.prefix(Messages.SHOP_OWNER_INFO));
Collection<UUID> accessors = chestShopMetaData.getAccessors();
StringBuilder accessorNames = new StringBuilder();
for (UUID accessorUUID : accessors) {
if (!accessorNames.isEmpty())
accessorNames.append(", ");
accessorNames.append(NameManager.getFullNameFor(accessorUUID));
if (!accessors.isEmpty()) {
player.sendMessage(Messages.prefix(Messages.SHOP_OWNER_INFO));
StringBuilder accessorNames = new StringBuilder();
for (UUID accessorUUID : accessors) {
if (!accessorNames.isEmpty()) {
accessorNames.append(", ");
}
accessorNames.append(NameManager.getFullNameFor(accessorUUID));
}

player.sendMessage(" " + Messages.SHOP_ACCESSORS.replace("%accessor_list", accessorNames.toString()));
}

player.sendMessage(" " + Messages.SHOP_ACCESSORS.replace("%accessor_list", accessorNames.toString()));
}

Container chest = uBlock.findConnectedChest(sign, true);
Expand Down Expand Up @@ -187,8 +191,9 @@ private static PreTransactionEvent preparePreTransactionEvent(Sign sign, Player
}

ChestShopMetaData chestShopMetaData = ChestShopSign.getChestShopMetaData(sign);
if (chestShopMetaData == null)
if (chestShopMetaData == null) {
return null;
}

UUID uuid = chestShopMetaData.getOwner();

Expand Down

0 comments on commit 453938c

Please sign in to comment.