mirror of
https://github.com/NLthijs48/AreaShop.git
synced 2024-11-16 15:25:11 +01:00
Fix message variables for '/as info player <player>' feedback
This commit is contained in:
parent
c858d30481
commit
3e7c7ce76b
@ -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<GeneralRegion> regions = new TreeSet<GeneralRegion>();
|
||||
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<GeneralRegion>();
|
||||
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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user