diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-05-26 16:23:11 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-05-26 16:23:36 +0100 |
commit | e4d041b9b03e36984ed108913bb2749ea7f5c4fd (patch) | |
tree | f79c1a36b75a546acb07c8558aa720317f771f48 | |
parent | 3bcd3390fe63c52beccfd99f8b8bc46a09d8923f (diff) | |
download | Essentials-e4d041b9b03e36984ed108913bb2749ea7f5c4fd.tar Essentials-e4d041b9b03e36984ed108913bb2749ea7f5c4fd.tar.gz Essentials-e4d041b9b03e36984ed108913bb2749ea7f5c4fd.tar.lz Essentials-e4d041b9b03e36984ed108913bb2749ea7f5c4fd.tar.xz Essentials-e4d041b9b03e36984ed108913bb2749ea7f5c4fd.zip |
Fix /helpop for console use.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java index 948cfa769..3a00c86e3 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandhelpop.java @@ -1,10 +1,11 @@ package com.earth2me.essentials.commands; +import com.earth2me.essentials.Console; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.Util; -import java.util.logging.Level; import org.bukkit.Server; +import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -18,13 +19,25 @@ public class Commandhelpop extends EssentialsCommand @Override public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { + user.setDisplayNick(); + sendMessage(server, user, user.getDisplayName(), args); + } + + @Override + public void run(final Server server, final CommandSender sender, final String commandLabel, final String[] args) throws Exception + { + sendMessage(server, sender, Console.NAME, args); + } + + private void sendMessage(final Server server, final CommandSender sender, final String from, final String[] args) throws Exception + { if (args.length < 1) { throw new NotEnoughArgumentsException(); } - user.setDisplayNick(); - final String message = _("helpOp", user.getDisplayName(), Util.stripFormat(getFinalArg(args, 0))); - logger.log(Level.INFO, message); + final String message = _("helpOp", from, Util.stripFormat(getFinalArg(args, 0))); + CommandSender cs = Console.getCommandSender(server); + cs.sendMessage(message); for (Player onlinePlayer : server.getOnlinePlayers()) { final User player = ess.getUser(onlinePlayer); |