diff --git a/src/main/java/dev/plex/command/impl/BanCMD.java b/src/main/java/dev/plex/command/impl/BanCMD.java index 86b4017..760c9e6 100644 --- a/src/main/java/dev/plex/command/impl/BanCMD.java +++ b/src/main/java/dev/plex/command/impl/BanCMD.java @@ -84,6 +84,10 @@ public class BanCMD extends PlexCommand punishment.setEndDate(date.plusDays(1)); punishment.setCustomTime(false); punishment.setActive(!isAdmin(plexPlayer)); + if (player != null) + { + punishment.setIp(player.getAddress().getAddress().getHostAddress().trim()); + } plugin.getPunishmentManager().doPunishment(punishedPlayer, punishment); PlexUtils.broadcast(messageComponent("banningPlayer", sender.getName(), plexPlayer.getName())); if (player != null) diff --git a/src/main/java/dev/plex/command/impl/FreezeCMD.java b/src/main/java/dev/plex/command/impl/FreezeCMD.java index 5fbdc69..4cd01aa 100644 --- a/src/main/java/dev/plex/command/impl/FreezeCMD.java +++ b/src/main/java/dev/plex/command/impl/FreezeCMD.java @@ -58,6 +58,7 @@ public class FreezeCMD extends PlexCommand punishment.setEndDate(date.plusMinutes(5)); punishment.setType(PunishmentType.FREEZE); punishment.setPunishedUsername(player.getName()); + punishment.setIp(player.getAddress().getAddress().getHostAddress().trim()); punishment.setReason(""); plugin.getPunishmentManager().doPunishment(punishedPlayer, punishment); diff --git a/src/main/java/dev/plex/command/impl/KickCMD.java b/src/main/java/dev/plex/command/impl/KickCMD.java index 78282e6..183acaf 100644 --- a/src/main/java/dev/plex/command/impl/KickCMD.java +++ b/src/main/java/dev/plex/command/impl/KickCMD.java @@ -63,6 +63,7 @@ public class KickCMD extends PlexCommand punishment.setEndDate(LocalDateTime.now()); punishment.setCustomTime(false); punishment.setActive(false); + punishment.setIp(player.getAddress().getAddress().getHostAddress().trim()); plugin.getPunishmentManager().doPunishment(punishedPlayer, punishment); PlexUtils.broadcast(messageComponent("kickedPlayer", sender.getName(), plexPlayer.getName())); player.kick(componentFromString(reason)); diff --git a/src/main/java/dev/plex/command/impl/MuteCMD.java b/src/main/java/dev/plex/command/impl/MuteCMD.java index c5c99ea..119bf40 100644 --- a/src/main/java/dev/plex/command/impl/MuteCMD.java +++ b/src/main/java/dev/plex/command/impl/MuteCMD.java @@ -58,6 +58,7 @@ public class MuteCMD extends PlexCommand punishment.setEndDate(date.plusMinutes(5)); punishment.setType(PunishmentType.MUTE); punishment.setPunishedUsername(player.getName()); + punishment.setIp(player.getAddress().getAddress().getHostAddress().trim()); punishment.setReason(""); plugin.getPunishmentManager().doPunishment(punishedPlayer, punishment); diff --git a/src/main/java/dev/plex/command/impl/TempbanCMD.java b/src/main/java/dev/plex/command/impl/TempbanCMD.java index 69f8c74..12e03a1 100644 --- a/src/main/java/dev/plex/command/impl/TempbanCMD.java +++ b/src/main/java/dev/plex/command/impl/TempbanCMD.java @@ -82,6 +82,10 @@ public class TempbanCMD extends PlexCommand punishment.setEndDate(PlexUtils.parseDateOffset(args[1])); punishment.setCustomTime(false); punishment.setActive(!isAdmin(plexPlayer)); + if (player != null) + { + punishment.setIp(player.getAddress().getAddress().getHostAddress().trim()); + } plugin.getPunishmentManager().doPunishment(punishedPlayer, punishment); PlexUtils.broadcast(messageComponent("banningPlayer", sender.getName(), plexPlayer.getName())); if (player != null) diff --git a/src/main/java/dev/plex/player/PunishedPlayer.java b/src/main/java/dev/plex/player/PunishedPlayer.java index 791bfa3..2b1565a 100644 --- a/src/main/java/dev/plex/player/PunishedPlayer.java +++ b/src/main/java/dev/plex/player/PunishedPlayer.java @@ -104,7 +104,6 @@ public class PunishedPlayer extends PlexBase } } return file; - } @SneakyThrows diff --git a/src/main/java/dev/plex/punishment/Punishment.java b/src/main/java/dev/plex/punishment/Punishment.java index 58634c2..ae257c2 100644 --- a/src/main/java/dev/plex/punishment/Punishment.java +++ b/src/main/java/dev/plex/punishment/Punishment.java @@ -23,7 +23,7 @@ public class Punishment private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("MM/dd/yyyy 'at' hh:mm:ss a"); private final UUID punished; private final UUID punisher; - private final List IPS; + private String ip; private String punishedUsername; private PunishmentType type; private String reason; @@ -35,8 +35,8 @@ public class Punishment { this.punished = punished; this.punisher = punisher; - this.IPS = Lists.newArrayList(); + this.ip = ""; this.punishedUsername = ""; this.type = null; this.reason = "";