mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-27 20:27:37 +00:00
Merge branch 'master', remote-tracking branch 'origin' into newconfig
This commit is contained in:
commit
881593e156
@ -293,6 +293,53 @@ public class TFM_Cmds_General implements CommandExecutor
|
||||
|
||||
sender.sendMessage(ChatColor.GRAY + banned_players.toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (cmd.getName().equalsIgnoreCase("ipbanlist"))
|
||||
{
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
if (senderIsConsole || plugin.isUserSuperadmin(sender))
|
||||
{
|
||||
for (String ip : Bukkit.getIPBans())
|
||||
{
|
||||
Bukkit.unbanIP(ip);
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.GRAY + "IP Ban list has been purged.");
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(ChatColor.YELLOW + "You do not have permission to purge the IP ban list, you may only view it.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<String> ip_bans = Arrays.asList(Bukkit.getIPBans().toArray(new String[0]));
|
||||
Collections.sort(ip_bans);
|
||||
|
||||
StringBuilder banned_ips = new StringBuilder();
|
||||
banned_ips.append("Banned IPs: ");
|
||||
boolean first = true;
|
||||
for (String ip : ip_bans)
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
banned_ips.append(", ");
|
||||
}
|
||||
if (ip.matches("\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}"))
|
||||
{
|
||||
first = false;
|
||||
banned_ips.append(ip.trim());
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.GRAY + banned_ips.toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -360,6 +360,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
this.getCommand("skylands").setExecutor(GeneralCommands);
|
||||
this.getCommand("nether").setExecutor(GeneralCommands);
|
||||
this.getCommand("banlist").setExecutor(GeneralCommands);
|
||||
this.getCommand("ipbanlist").setExecutor(GeneralCommands);
|
||||
|
||||
this.getCommand("fr").setExecutor(AdminCommands);
|
||||
this.getCommand("gtfo").setExecutor(AdminCommands);
|
||||
|
@ -46,6 +46,9 @@ commands:
|
||||
gtfo:
|
||||
description: Superadmin command - Makes someone GTFO (deop and ip ban by username).
|
||||
usage: /<command> <partialname>
|
||||
ipbanlist:
|
||||
description: Shows all banned IPs. Superadmins may optionally use 'purge' to clear the list.
|
||||
usage: /<command> [purge]
|
||||
lavadmg:
|
||||
description: Superadmin command - Enable/disable lava damage.
|
||||
usage: /<command> <on|off>
|
||||
|
Loading…
Reference in New Issue
Block a user