From c17507975cf3758b2ada3826ea22b50c26e1cc4f Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 15 Jul 2011 20:28:15 +0100 Subject: [PATCH 1/3] Adjust the help for more alias' --- Essentials/src/plugin.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Essentials/src/plugin.yml b/Essentials/src/plugin.yml index d3113a636..26bcf5806 100644 --- a/Essentials/src/plugin.yml +++ b/Essentials/src/plugin.yml @@ -30,7 +30,7 @@ commands: balancetop: description: Gets the top x balance values. (max 10) usage: / - aliases: + aliases: [baltop,ebaltop,ebalancetop] ban: description: Bans a player. usage: / [player] @@ -58,6 +58,7 @@ commands: compass: description: Describes your current bearing. usage: / + aliases: [ecompass] deljail: description: Removes a jail usage: / [jailname] @@ -80,7 +81,7 @@ commands: ext: description: Extinguish players. usage: / - aliases: [extinguish] + aliases: [extinguish,eext,eextinguish] fireball: description: Throw a fireball. usage: / @@ -162,6 +163,7 @@ commands: lightning: description: The power of Thor. Strike at cursor or player. usage: / [player] + aliases: [strike,elightning,estrike] mail: description: Manages inter-player, intra-server mail. usage: / [read|clear|send [to] [message]] @@ -205,7 +207,7 @@ commands: r: description: Quickly reply to the last player to message you. usage: / [message] - aliases: [er] + aliases: [er,reply,ereply] realname: description: Displays the username of a user based on nickname. usage: / [nickname] From 54c7ab58c774bed4aaebcd46744a545e45915d9c Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 15 Jul 2011 20:56:58 +0100 Subject: [PATCH 2/3] Adding a failure message for help search --- .../earth2me/essentials/commands/Commandhelp.java | 14 +++++++++++--- Essentials/src/messages_en.properties | 1 + 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 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. From 970db678b39fb17641d7cd386d7a583833646d39 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 15 Jul 2011 20:59:40 +0100 Subject: [PATCH 3/3] Format. --- .../essentials/commands/Commandhelp.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java index 932f45974..c105e2e41 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelp.java @@ -56,21 +56,20 @@ public class Commandhelp extends EssentialsCommand List lines = getHelpLines(user, match); 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)); - } + 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