From 132ddc323f7642eb669687e5ecdfef9d851bc1cc Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 15 Jul 2011 20:28:15 +0100 Subject: [PATCH 1/5] 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 39352da929d4e6b8c536e1fb313019863e24ea6d Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 15 Jul 2011 20:56:58 +0100 Subject: [PATCH 2/5] 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 d7080950b09410073cec3857e993db29be36ef99 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Fri, 15 Jul 2011 20:59:40 +0100 Subject: [PATCH 3/5] 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 From 1696d7ae71c9aa8682d127b788067617e38fda60 Mon Sep 17 00:00:00 2001 From: ementalo Date: Sat, 16 Jul 2011 01:05:11 +0100 Subject: [PATCH 4/5] Test #393 adding optional ban reason with tempban /tempban player time reason, also adding essentials.tempban.exempt --- .../com/earth2me/essentials/commands/Commandtempban.java | 7 +++++-- Essentials/src/messages.properties | 1 + Essentials/src/messages_da.properties | 1 + Essentials/src/messages_de.properties | 1 + Essentials/src/messages_en.properties | 1 + Essentials/src/messages_fr.properties | 1 + Essentials/src/messages_nl.properties | 1 + 7 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index ffa63597d..291efd02d 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -20,12 +20,15 @@ public class Commandtempban extends EssentialsCommand { throw new NotEnoughArgumentsException(); } - final User player = getPlayer(server, args, 0, true); + if(player.isAuthorized("essentials.tempban.exempt")) + { + sender.sendMessage(Util.i18n("tempbanExempt")); + } final String time = getFinalArg(args, 1); final long banTimestamp = Util.parseDateDiff(time, true); - final String banReason = Util.format("tempBanned", Util.formatDateDiff(banTimestamp)); + final String banReason = (args.length == 3 && !args[2].isEmpty()) ? args[2].toString() + " - " + Util.formatDateDiff(banTimestamp) : Util.format("tempBanned", Util.formatDateDiff(banTimestamp)); player.setBanReason(banReason); player.setBanTimeout(banTimestamp); player.kickPlayer(banReason); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index a968d4153..cd7607c24 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -256,6 +256,7 @@ teleportationEnabled = \u00a77Teleportation enabled. teleporting = \u00a77Teleporting... teleportingPortal = \u00a77Teleporting via portal. tempBanned = Temporarily banned from server for {0} +tempbanExempt = \u00a77You may not tempban that player thunder = You {0} thunder in your world thunderDuration = You {0} thunder in your world for {1} seconds. timeBeforeHeal = Time before next heal: {0} diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index e471b7dd0..bd0352289 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -258,6 +258,7 @@ teleportationEnabled = \u00a77Teleportering aktiveret. teleporting = \u00a77Teleportere... teleportingPortal = \u00a77Teleporterede via portal. tempBanned = Midlertidigt bannet fra serveren for {0} +tempbanExempt = \u00a77You may not tempban that player thunder = Du {0} torden i din verden thunderDuration = Du {0} torden i din verden i {1} sekunder. timeBeforeHeal = Tid inden n\u00e6ste helbredelse: {0} diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index a01c0e211..cfc7f41e4 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -256,6 +256,7 @@ teleportationEnabled = \u00a77Teleportierung aktiviert. teleporting = \u00a77Teleportiere... teleportingPortal = \u00a77Teleportiere durch Portal. tempBanned = Zeitlich gesperrt vom Server f\u00fcr {0} +tempbanExempt = \u00a77You may not tempban that player thunder = Du hast Donner in deiner Welt {0}. thunderDuration = Du hast Donner in deiner Welt {0} f\u00fcr {1} Sekunden. timeBeforeHeal = Zeit bis zur n\u00e4chsten Heilung: {0} diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties index 7d838ed09..b8d479a78 100644 --- a/Essentials/src/messages_en.properties +++ b/Essentials/src/messages_en.properties @@ -256,6 +256,7 @@ teleportationEnabled = \u00a77Teleportation enabled. teleporting = \u00a77Teleporting... teleportingPortal = \u00a77Teleporting via portal. tempBanned = Temporarily banned from server for {0} +tempbanExempt = \u00a77You may not tempban that player thunder = You {0} thunder in your world thunderDuration = You {0} thunder in your world for {1} seconds. timeBeforeHeal = Time before next heal: {0} diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index bbdd5888a..e5591cb96 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -256,6 +256,7 @@ teleportationEnabled = \u00a77T\u00e9l\u00e9portation activ\u00e9e. teleporting = \u00a77T\u00e9l\u00e9poration en cours... teleportingPortal = \u00a77T\u00e9l\u00e9portation via portail. tempBanned = Banni temporairement du serveur pour {0} +tempbanExempt = \u00a77You may not tempban that player thunder = Vous avez {0} la foudre dans votre monde. thunderDuration = Vous avez {0} la foudre dans le serveur {1} secondes. timeBeforeHeal = Temps avant le prochain soin : {0} diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index 5ce098bdf..5091b6d42 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -257,6 +257,7 @@ teleportationEnabled = \u00a77Teleportatie ingeschakeld. teleporting = \u00a77Bezig met teleporteren... teleportingPortal = \u00a77Bezig met teleporteren via de portal. tempBanned = Tijdelijk geband voor {0} +tempbanExempt = \u00a77You may not tempban that player thunder = Je {0} onweert de wereld thunderDuration = Je {0} onweert de wereld voor {1} seconde. timeBeforeHeal = Afkoeltijd tot de volgende heal: {0} From a0554f566dad98e4aa5d719bb90ce13951c57535 Mon Sep 17 00:00:00 2001 From: ementalo Date: Sat, 16 Jul 2011 01:09:28 +0100 Subject: [PATCH 5/5] This change did not commit --- .../src/com/earth2me/essentials/commands/Commandtempban.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java index 291efd02d..f1d91d2ac 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java @@ -21,9 +21,10 @@ public class Commandtempban extends EssentialsCommand throw new NotEnoughArgumentsException(); } final User player = getPlayer(server, args, 0, true); - if(player.isAuthorized("essentials.tempban.exempt")) + if (player.isAuthorized("essentials.tempban.exempt")) { sender.sendMessage(Util.i18n("tempbanExempt")); + return; } final String time = getFinalArg(args, 1); final long banTimestamp = Util.parseDateDiff(time, true);