summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2011-07-15 20:56:58 +0100
committerKHobbits <rob@khobbits.co.uk>2011-07-15 20:56:58 +0100
commit39352da929d4e6b8c536e1fb313019863e24ea6d (patch)
tree36dd4b07e7ffed1fcaf55f1f9b18464731a7e18f
parent132ddc323f7642eb669687e5ecdfef9d851bc1cc (diff)
downloadEssentials-39352da929d4e6b8c536e1fb313019863e24ea6d.tar
Essentials-39352da929d4e6b8c536e1fb313019863e24ea6d.tar.gz
Essentials-39352da929d4e6b8c536e1fb313019863e24ea6d.tar.lz
Essentials-39352da929d4e6b8c536e1fb313019863e24ea6d.tar.xz
Essentials-39352da929d4e6b8c536e1fb313019863e24ea6d.zip
Adding a failure message for help search
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandhelp.java14
-rw-r--r--Essentials/src/messages_en.properties1
2 files changed, 12 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
index 10e8f31ab..932f45974 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java
@@ -54,15 +54,23 @@ public class Commandhelp extends EssentialsCommand
}
List<String> lines = getHelpLines(user, match);
- int start = (page - 1) * 9;
+ if (lines.size() > 0)
+ {
+ int start = (page - 1) * 9;
int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
-
+
user.sendMessage(Util.format("helpPages", page, pages));
for (int i = start; i < lines.size() && i < start + 9; i++)
{
user.sendMessage(lines.get(i));
}
- }
+ }
+ else
+ {
+ user.sendMessage(Util.i18n("noHelpFound"));
+ }
+}
+
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index b619cf2ab..d99e1ee7f 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -180,6 +180,7 @@ nickSet = \u00a77Your nickname is now \u00a7c{0}
noAccessCommand = \u00a7cYou do not have access to that command.
noAccessPermission = \u00a7cYou do not have permission to access that {0}.
noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}.
+noHelpFound = \u00a7cNo matching commands.
noHomeSet = You have not set a home.
noHomeSetPlayer = Player has not set a home.
noKitPermission = \u00a7cYou need the \u00a7c{0}\u00a7c permission to use that kit.