actually fix it this time

This commit is contained in:
Telesphoreo 2022-04-04 15:22:04 -05:00
parent c8a64cc9cb
commit 8a0c354682

View File

@ -35,7 +35,6 @@ public class UnbanCMD extends PlexCommand
if (args.length == 1) if (args.length == 1)
{ {
UUID targetUUID = PlexUtils.getFromName(args[0]); UUID targetUUID = PlexUtils.getFromName(args[0]);
PlexPlayer plexPlayer = getOfflinePlexPlayer(targetUUID);
if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID))
{ {
@ -47,6 +46,7 @@ public class UnbanCMD extends PlexCommand
throw new PlayerNotBannedException(); throw new PlayerNotBannedException();
} }
PlexPlayer plexPlayer = getOfflinePlexPlayer(targetUUID);
plugin.getPunishmentManager().unban(targetUUID); plugin.getPunishmentManager().unban(targetUUID);
PlexUtils.broadcast(messageComponent("unbanningPlayer", sender.getName(), plexPlayer.getName())); PlexUtils.broadcast(messageComponent("unbanningPlayer", sender.getName(), plexPlayer.getName()));
} }