From 3e7c7ce76b281f01a36e1505c1da576decff5790 Mon Sep 17 00:00:00 2001 From: Thijs Wiefferink Date: Sat, 31 Oct 2015 23:15:11 +0100 Subject: [PATCH] Fix message variables for '/as info player ' feedback --- .../areashop/commands/InfoCommand.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/InfoCommand.java b/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/InfoCommand.java index f9135dd..60a5cb6 100644 --- a/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/InfoCommand.java +++ b/AreaShop/src/main/java/nl/evolutioncoding/areashop/commands/InfoCommand.java @@ -137,21 +137,30 @@ public class InfoCommand extends CommandAreaShop { // Player regions else if(args[1].equalsIgnoreCase("player")) { if(args.length > 2 && args[2] != null) { + // Rents Set regions = new TreeSet(); for(RentRegion region : plugin.getFileManager().getRents()) { if(region.isRented() && region.getPlayerName().equalsIgnoreCase(args[2])) { regions.add(region); } } - displayMessage(sender, regions, null, "info-playerRents", "info-playerNoRents"); - + if(regions.isEmpty()) { + plugin.message(sender, "info-playerNoRents", args[2]); + } else { + plugin.message(sender, "info-playerRents", args[2], StringUtils.join(regions.iterator(), ", ")); + } + // Buys regions = new TreeSet(); for(BuyRegion region : plugin.getFileManager().getBuys()) { if(region.isSold() && region.getPlayerName().equalsIgnoreCase(args[2])) { regions.add(region); } } - displayMessage(sender, regions, null, "info-playerBuys", "info-playerNoBuys"); + if(regions.isEmpty()) { + plugin.message(sender, "info-playerNoBuys", args[2]); + } else { + plugin.message(sender, "info-playerBuys", args[2], StringUtils.join(regions.iterator(), ", ")); + } } else { plugin.message(sender, "info-playerHelp"); }