mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 20:29:20 +00:00
Optional argument to /ping [message]- Message to be echo'd.
Possible use in scripts, checking for lag, /sudo, etc.
This commit is contained in:
parent
691a0ef4ce
commit
83f9209bcc
1 changed files with 12 additions and 3 deletions
|
@ -1,8 +1,9 @@
|
||||||
package com.earth2me.essentials.commands;
|
package com.earth2me.essentials.commands;
|
||||||
|
|
||||||
import static com.earth2me.essentials.I18n._;
|
import static com.earth2me.essentials.I18n._;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.Util;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
|
|
||||||
public class Commandping extends EssentialsCommand
|
public class Commandping extends EssentialsCommand
|
||||||
|
@ -13,8 +14,16 @@ public class Commandping extends EssentialsCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue