mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-19 09:06:09 +01:00
Fix /helpop for console use.
This commit is contained in:
parent
3bcd3390fe
commit
e4d041b9b0
@ -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;
|
||||
|
||||
|
||||
@ -17,14 +18,26 @@ 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);
|
||||
|
Loading…
Reference in New Issue
Block a user