mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +00:00
Comply with suggestion to remove IPs announcing on ban or unban
This commit is contained in:
parent
6187c9c068
commit
c01c436d40
@ -7,7 +7,9 @@ import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
|
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||||
import net.pravian.aero.util.Ips;
|
import net.pravian.aero.util.Ips;
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@ -109,7 +111,8 @@ public class Command_doom extends FreedomCommand
|
|||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
// message
|
// message
|
||||||
FUtil.adminAction(sender.getName(), "Banning " + player.getName() + ", IP: " + ip, true);
|
FUtil.adminAction(sender.getName(), "Banning " + player.getName(), true);
|
||||||
|
playerMsg(sender, ChatColor.GRAY + player.getName() + " has been banned and IP is: " + ip);
|
||||||
|
|
||||||
// generate explosion
|
// generate explosion
|
||||||
player.getWorld().createExplosion(player.getLocation(), 0F, false);
|
player.getWorld().createExplosion(player.getLocation(), 0F, false);
|
||||||
|
@ -12,6 +12,8 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
|
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||||
|
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
@CommandPermissions(level = Rank.SUPER_ADMIN, source = SourceType.BOTH, blockHostConsole = true)
|
||||||
@ -94,7 +96,8 @@ public class Command_glist extends FreedomCommand
|
|||||||
playerBan.addIp(ip);
|
playerBan.addIp(ip);
|
||||||
playerBan.addIp(FUtil.getFuzzyIp(ip));
|
playerBan.addIp(FUtil.getFuzzyIp(ip));
|
||||||
}
|
}
|
||||||
FUtil.adminAction(sender.getName(), "Banning " + username + " and IPs: " + StringUtils.join(ips, ", "), true);
|
FUtil.adminAction(sender.getName(), "Banning " + username, true);
|
||||||
|
playerMsg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", "));
|
||||||
|
|
||||||
plugin.bm.addBan(playerBan);
|
plugin.bm.addBan(playerBan);
|
||||||
|
|
||||||
@ -113,7 +116,8 @@ public class Command_glist extends FreedomCommand
|
|||||||
msg("Please specify a player, not an ip.");
|
msg("Please specify a player, not an ip.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
FUtil.adminAction(sender.getName(), "Unbanning " + username + " and IPs: " + StringUtils.join(ips, ", "), true);
|
FUtil.adminAction(sender.getName(), "Unbanning " + username, true);
|
||||||
|
playerMsg(sender, ChatColor.GRAY + username + " has been unbanned and IP is: " + StringUtils.join(ips, ", "));
|
||||||
plugin.bm.removeBan(plugin.bm.getByUsername(username));
|
plugin.bm.removeBan(plugin.bm.getByUsername(username));
|
||||||
|
|
||||||
for (String ip : ips)
|
for (String ip : ips)
|
||||||
@ -169,7 +173,8 @@ public class Command_glist extends FreedomCommand
|
|||||||
final String ipBanReason = args.length > 2 ? StringUtils.join(args, " ", 2, args.length) : null;
|
final String ipBanReason = args.length > 2 ? StringUtils.join(args, " ", 2, args.length) : null;
|
||||||
Ban ipBan = Ban.forPlayerIp(banIp, sender, null, ipBanReason);
|
Ban ipBan = Ban.forPlayerIp(banIp, sender, null, ipBanReason);
|
||||||
plugin.bm.addBan(ipBan);
|
plugin.bm.addBan(ipBan);
|
||||||
FUtil.adminAction(sender.getName(), "Banning IP: " + banIp, true);
|
FUtil.adminAction(sender.getName(), "Banned an IP", true);
|
||||||
|
playerMsg(sender, ChatColor.GRAY + "Banned IP: " + banIp);
|
||||||
return true;
|
return true;
|
||||||
case "unbanip":
|
case "unbanip":
|
||||||
case "pardonip":
|
case "pardonip":
|
||||||
@ -179,7 +184,8 @@ public class Command_glist extends FreedomCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FUtil.adminAction(sender.getName(), "Unbanning IP: " + banIp, true);
|
FUtil.adminAction(sender.getName(), "Unbanned an IP", true);
|
||||||
|
playerMsg(sender, ChatColor.GRAY + "Unbanned IP: " + banIp);
|
||||||
Ban ipUnban = plugin.bm.getByIp(banIp);
|
Ban ipUnban = plugin.bm.getByIp(banIp);
|
||||||
if (ipUnban != null)
|
if (ipUnban != null)
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
|
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -139,9 +140,8 @@ public class Command_gtfo extends FreedomCommand
|
|||||||
.append(sender.getName())
|
.append(sender.getName())
|
||||||
.append(" - ")
|
.append(" - ")
|
||||||
.append("Banning: ")
|
.append("Banning: ")
|
||||||
.append(username)
|
.append(username);
|
||||||
.append(", IPs: ")
|
playerMsg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", "));
|
||||||
.append(StringUtils.join(ips, ", "));
|
|
||||||
if (reason != null)
|
if (reason != null)
|
||||||
{
|
{
|
||||||
bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason);
|
bcast.append(" - Reason: ").append(ChatColor.YELLOW).append(reason);
|
||||||
|
Loading…
Reference in New Issue
Block a user