summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-02-09 22:02:24 +0000
committerKHobbits <rob@khobbits.co.uk>2012-02-09 22:02:24 +0000
commit83f9209bcc3edb20d86975ae33e608005ece555b (patch)
treeec4f6f25133e0fec296984886b27a33be217ca8b
parent691a0ef4ce21b66cd948dc234d8659b8f8a422db (diff)
downloadEssentials-83f9209bcc3edb20d86975ae33e608005ece555b.tar
Essentials-83f9209bcc3edb20d86975ae33e608005ece555b.tar.gz
Essentials-83f9209bcc3edb20d86975ae33e608005ece555b.tar.lz
Essentials-83f9209bcc3edb20d86975ae33e608005ece555b.tar.xz
Essentials-83f9209bcc3edb20d86975ae33e608005ece555b.zip
Optional argument to /ping [message]- Message to be echo'd.
Possible use in scripts, checking for lag, /sudo, etc.
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandping.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandping.java b/Essentials/src/com/earth2me/essentials/commands/Commandping.java
index 1fad701b2..9c90866d6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandping.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandping.java
@@ -1,8 +1,9 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
-import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import org.bukkit.Server;
+import org.bukkit.command.CommandSender;
public class Commandping extends EssentialsCommand
@@ -13,8 +14,16 @@ public class Commandping extends EssentialsCommand
}
@Override
- public void run(Server server, User player, String commandLabel, String[] args) throws Exception
+ public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception
{
- player.sendMessage(_("pong"));
+ if (args.length < 1)
+ {
+
+ sender.sendMessage(_("pong"));
+ }
+ else
+ {
+ sender.sendMessage(getFinalArg(args, 0));
+ }
}
}