From 542bba062cdccb035a5f025d2ea73064f2e3e3d3 Mon Sep 17 00:00:00 2001 From: spacerocket62 Date: Thu, 5 Nov 2020 23:07:28 -0800 Subject: [PATCH] oh lol we have a playernotfoundexception --- .../me/totalfreedom/plex/command/impl/AdminCMD.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java b/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java index 8c4dfa6..025a1fd 100644 --- a/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java +++ b/src/main/java/me/totalfreedom/plex/command/impl/AdminCMD.java @@ -8,6 +8,7 @@ import me.totalfreedom.plex.cache.DataUtils; import me.totalfreedom.plex.command.PlexCommand; import me.totalfreedom.plex.command.annotation.CommandParameters; import me.totalfreedom.plex.command.annotation.CommandPermissions; +import me.totalfreedom.plex.command.exception.PlayerNotFoundException; import me.totalfreedom.plex.command.source.CommandSource; import me.totalfreedom.plex.command.source.RequiredCommandSource; import me.totalfreedom.plex.event.AdminAddEvent; @@ -49,8 +50,7 @@ public class AdminCMD extends PlexCommand if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) { - sender.send(tl("playerNotFound")); - return; + throw new PlayerNotFoundException(); } PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); plexPlayer.setRank(Rank.ADMIN.name()); @@ -70,8 +70,7 @@ public class AdminCMD extends PlexCommand if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) { - sender.send(tl("playerNotFound")); - return; + throw new PlayerNotFoundException(); } PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); plexPlayer.setRank(""); @@ -92,8 +91,7 @@ public class AdminCMD extends PlexCommand if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) { - sender.send(tl("playerNotFound")); - return; + throw new PlayerNotFoundException(); } if (!rankExists(args[2]))