2012-09-18 14:40:48 +00:00
|
|
|
package me.StevenLawson.TotalFreedomMod.Commands;
|
|
|
|
|
|
|
|
import me.StevenLawson.TotalFreedomMod.TFM_Util;
|
|
|
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
2012-09-19 02:21:25 +00:00
|
|
|
import org.bukkit.ChatColor;
|
2012-09-18 14:40:48 +00:00
|
|
|
import org.bukkit.command.Command;
|
|
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
|
2012-11-24 01:22:52 +00:00
|
|
|
@CommandPermissions(level = ADMIN_LEVEL.SENIOR, source = SOURCE_TYPE_ALLOWED.ONLY_CONSOLE, block_web_console = true, ignore_permissions = false)
|
2012-09-18 14:40:48 +00:00
|
|
|
public class Command_permban extends TFM_Command
|
|
|
|
{
|
2012-09-18 21:25:37 +00:00
|
|
|
@Override
|
2012-09-18 14:40:48 +00:00
|
|
|
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
|
|
|
{
|
2012-09-18 21:25:37 +00:00
|
|
|
if (args.length != 1)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (args[0].equalsIgnoreCase("list"))
|
|
|
|
{
|
2012-09-19 02:21:25 +00:00
|
|
|
dumplist(sender);
|
2012-09-18 21:25:37 +00:00
|
|
|
}
|
2012-11-24 01:22:52 +00:00
|
|
|
else if (args[0].equalsIgnoreCase("reload"))
|
2012-09-18 21:25:37 +00:00
|
|
|
{
|
2012-09-19 02:21:25 +00:00
|
|
|
TFM_Util.playerMsg(sender, "Reloading permban list...", ChatColor.RED);
|
2012-09-18 21:25:37 +00:00
|
|
|
plugin.loadPermbanConfig();
|
2012-09-19 02:21:25 +00:00
|
|
|
dumplist(sender);
|
2012-11-24 01:22:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
2012-09-18 21:25:37 +00:00
|
|
|
}
|
|
|
|
|
2012-11-24 01:22:52 +00:00
|
|
|
return true;
|
2012-09-18 14:40:48 +00:00
|
|
|
}
|
2012-09-19 02:21:25 +00:00
|
|
|
|
|
|
|
private void dumplist(CommandSender sender)
|
|
|
|
{
|
|
|
|
if (TotalFreedomMod.permbanned_players.isEmpty())
|
|
|
|
{
|
|
|
|
TFM_Util.playerMsg(sender, "No permanently banned player names.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TFM_Util.playerMsg(sender, TotalFreedomMod.permbanned_players.size() + " permanently banned players:");
|
|
|
|
for (String player_name : TotalFreedomMod.permbanned_players)
|
|
|
|
{
|
|
|
|
TFM_Util.playerMsg(sender, "- " + player_name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (TotalFreedomMod.permbanned_ips.isEmpty())
|
|
|
|
{
|
|
|
|
TFM_Util.playerMsg(sender, "No permanently banned IPs.");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
TFM_Util.playerMsg(sender, TotalFreedomMod.permbanned_ips.size() + " permanently banned IPs:");
|
|
|
|
for (String ip_address : TotalFreedomMod.permbanned_ips)
|
|
|
|
{
|
|
|
|
TFM_Util.playerMsg(sender, "- " + ip_address);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-09-18 14:40:48 +00:00
|
|
|
}
|