mirror of
https://github.com/plexusorg/Plex.git
synced 2025-07-01 23:56:40 +00:00
Add IP Banning by getting every IP punishment through SQL and checking if it's the same IP, if it's a ban / tempban, and if it's active
Make the ban command add the most recent IP used by a PlexPlayer if the player being banned is not online, else use online player's IP
This commit is contained in:
@ -80,10 +80,7 @@ public class BanCMD extends PlexCommand
|
||||
punishment.setEndDate(date.plusDays(1));
|
||||
punishment.setCustomTime(false);
|
||||
punishment.setActive(true);
|
||||
if (player != null)
|
||||
{
|
||||
punishment.setIp(player.getAddress().getAddress().getHostAddress().trim());
|
||||
}
|
||||
punishment.setIp(player != null ? player.getAddress().getAddress().getHostAddress().trim() : plexPlayer.getIps().get(plexPlayer.getIps().size() - 1));
|
||||
plugin.getPunishmentManager().punish(plexPlayer, punishment);
|
||||
PlexUtils.broadcast(messageComponent("banningPlayer", sender.getName(), plexPlayer.getName()));
|
||||
Bukkit.getScheduler().runTask(Plex.get(), () ->
|
||||
|
Reference in New Issue
Block a user