From 7af7e42d38d8889d5741bf92bc8626f298e723e9 Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Sun, 4 Mar 2012 21:34:07 +0100 Subject: [PATCH] a little bit of cleanup --- .../mcteam/ancientgates/commands/CommandList.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/org/mcteam/ancientgates/commands/CommandList.java b/src/org/mcteam/ancientgates/commands/CommandList.java index fd3694f..3c663d1 100644 --- a/src/org/mcteam/ancientgates/commands/CommandList.java +++ b/src/org/mcteam/ancientgates/commands/CommandList.java @@ -124,9 +124,11 @@ public class CommandList extends BaseCommand if (currentPage == page) + { pageMessages.add(TextUtil.implode(currentIds, ", ")); - if (currentPage == page && finishedCurrentIds == false) - pageMessages.set(pageMessages.size() -2, pageMessages.get(pageMessages.size() -2) + " (more on previous page)"); + if (finishedCurrentIds == false) + pageMessages.set(pageMessages.size() -2, pageMessages.get(pageMessages.size() -2) + " (more on previous page)"); + } finishedCurrentIds = true; } @@ -174,9 +176,11 @@ public class CommandList extends BaseCommand return null; else { - // not nice! TODO: find a better way to send this message! - sendMessage(ChatColor.LIGHT_PURPLE + "This is page " + ChatColor.WHITE + page + ChatColor.LIGHT_PURPLE + "/" + ChatColor.WHITE + --currentPage + ChatColor.LIGHT_PURPLE + ". There are " + gates.size() + " gates on this server: "); - return pageMessages; + ArrayList retVal = new ArrayList(); + retVal.add(ChatColor.LIGHT_PURPLE + "This is page " + ChatColor.WHITE + page + ChatColor.LIGHT_PURPLE + "/" + ChatColor.WHITE + --currentPage + ChatColor.LIGHT_PURPLE + ". There are " + gates.size() + " gates on this server: "); + retVal.addAll(pageMessages); + + return retVal; } }