Make /doom ban all IPs

Before, /doom would only ban the current IP
This commit is contained in:
unknown 2014-05-05 16:10:14 +02:00
parent 9bc0859fdf
commit 8a4fa946fd
4 changed files with 11 additions and 8 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Mon May 05 16:00:01 CEST 2014 #Mon May 05 16:09:04 CEST 2014
build.number=822 build.number=823

View File

@ -35,7 +35,7 @@ public class Command_cage extends TFM_Command
} }
else if ("purge".equals(args[0])) else if ("purge".equals(args[0]))
{ {
TFM_Util.adminAction(sender.getName(), "Uncaging all players.", true); TFM_Util.adminAction(sender.getName(), "Uncaging all players", true);
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {

View File

@ -13,10 +13,9 @@ public class Command_denick extends TFM_Command
@Override @Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
TFM_Util.adminAction(sender.getName(), "Removing all nicknames.", false); TFM_Util.adminAction(sender.getName(), "Removing all nicknames", false);
Player[] onlinePlayers = server.getOnlinePlayers(); for (Player player : server.getOnlinePlayers())
for (Player player : onlinePlayers)
{ {
TFM_EssentialsBridge.getInstance().setNickname(player.getName(), null); TFM_EssentialsBridge.getInstance().setNickname(player.getName(), null);
} }

View File

@ -3,6 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Ban; import me.StevenLawson.TotalFreedomMod.TFM_Ban;
import me.StevenLawson.TotalFreedomMod.TFM_BanManager; import me.StevenLawson.TotalFreedomMod.TFM_BanManager;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod; import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -51,8 +52,11 @@ public class Command_doom extends TFM_Command
// deop // deop
player.setOp(false); player.setOp(false);
// ban IP // ban IPs
TFM_BanManager.getInstance().addIpBan(new TFM_Ban(ip, player.getName())); for (String playerIp : TFM_PlayerList.getInstance().getEntry(player).getIps())
{
TFM_BanManager.getInstance().addIpBan(new TFM_Ban(playerIp, player.getName()));
}
// ban name // ban name
TFM_BanManager.getInstance().addUuidBan(new TFM_Ban(player.getUniqueId(), player.getName())); TFM_BanManager.getInstance().addUuidBan(new TFM_Ban(player.getUniqueId(), player.getName()));