mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
parent
046bebe54c
commit
682145eb13
@ -45,7 +45,6 @@ public class Ban implements ConfigLoadable, ConfigSavable, Validatable
|
||||
@Getter
|
||||
@Setter
|
||||
private long expiryUnix = -1;
|
||||
private Player player;
|
||||
|
||||
public Ban()
|
||||
{
|
||||
@ -172,7 +171,7 @@ public class Ban implements ConfigLoadable, ConfigSavable, Validatable
|
||||
return hasExpiry() && expiryUnix < FUtil.getUnixTime();
|
||||
}
|
||||
|
||||
public String bakeKickMessage()
|
||||
public String bakeKickMessage(String ip)
|
||||
{
|
||||
final StringBuilder message = new StringBuilder(ChatColor.GOLD + "You");
|
||||
|
||||
@ -205,7 +204,7 @@ public class Ban implements ConfigLoadable, ConfigSavable, Validatable
|
||||
}
|
||||
|
||||
message.append("\n").append(ChatColor.RED).append("IP Address: ").append(ChatColor.GOLD)
|
||||
.append(FUtil.getFuzzyIp(Ips.getIp(player)));
|
||||
.append(ip);
|
||||
|
||||
return message.toString();
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ public class BanManager extends FreedomService
|
||||
|
||||
if (ban != null && !ban.isExpired())
|
||||
{
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, ban.bakeKickMessage());
|
||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, ban.bakeKickMessage(ip));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,11 +8,12 @@ import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import net.pravian.aero.util.Ips;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.ChatColor;
|
||||
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||
|
||||
|
||||
@ -103,7 +104,7 @@ public class Command_glist extends FreedomCommand
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
player.kickPlayer(playerBan.bakeKickMessage());
|
||||
player.kickPlayer(playerBan.bakeKickMessage(Ips.getIp(player)));
|
||||
}
|
||||
|
||||
plugin.pul.logPunishment(new Punishment(username, ips.get(0), sender.getName(), PunishmentType.BAN, null));
|
||||
@ -148,7 +149,7 @@ public class Command_glist extends FreedomCommand
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
player.kickPlayer(nameBan.bakeKickMessage());
|
||||
player.kickPlayer(nameBan.bakeKickMessage(Ips.getIp(player)));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -183,7 +183,7 @@ public class Command_gtfo extends FreedomCommand
|
||||
// Kick player and handle others on IP
|
||||
if (player != null)
|
||||
{
|
||||
player.kickPlayer(ban.bakeKickMessage());
|
||||
player.kickPlayer(ban.bakeKickMessage(Ips.getIp(player)));
|
||||
for (Player p : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (Ips.getIp(p).equals(Ips.getIp(player)))
|
||||
|
Loading…
Reference in New Issue
Block a user