2016-03-02 19:28:01 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.command;
|
2013-09-24 14:13:38 +00:00
|
|
|
|
2016-03-06 15:56:15 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
2015-10-19 17:43:46 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
2013-09-24 14:13:38 +00:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2016-03-06 15:56:15 +00:00
|
|
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH)
|
2013-09-24 14:13:38 +00:00
|
|
|
@CommandParameters(description = "Essentials Interface Command - Remove the nickname of all players on the server.", usage = "/<command>")
|
2015-10-19 17:43:46 +00:00
|
|
|
public class Command_denick extends FreedomCommand
|
2013-09-24 14:13:38 +00:00
|
|
|
{
|
2015-11-22 18:26:47 +00:00
|
|
|
|
2013-09-24 14:13:38 +00:00
|
|
|
@Override
|
2015-11-22 18:26:47 +00:00
|
|
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
2013-09-24 14:13:38 +00:00
|
|
|
{
|
2018-07-28 07:11:48 +00:00
|
|
|
if (!plugin.esb.isEssentialsEnabled())
|
|
|
|
{
|
|
|
|
msg("Essentials is not enabled on this server.");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2015-10-19 17:43:46 +00:00
|
|
|
FUtil.adminAction(sender.getName(), "Removing all nicknames", false);
|
2013-09-24 14:13:38 +00:00
|
|
|
|
2014-05-05 14:10:14 +00:00
|
|
|
for (Player player : server.getOnlinePlayers())
|
2013-09-24 14:13:38 +00:00
|
|
|
{
|
2015-10-19 17:43:46 +00:00
|
|
|
plugin.esb.setNickname(player.getName(), null);
|
2013-09-24 14:13:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|