oh lol we have a playernotfoundexception

This commit is contained in:
spacerocket62 2020-11-05 23:07:28 -08:00
parent ba494f6892
commit 542bba062c

View File

@ -8,6 +8,7 @@ import me.totalfreedom.plex.cache.DataUtils;
import me.totalfreedom.plex.command.PlexCommand; import me.totalfreedom.plex.command.PlexCommand;
import me.totalfreedom.plex.command.annotation.CommandParameters; import me.totalfreedom.plex.command.annotation.CommandParameters;
import me.totalfreedom.plex.command.annotation.CommandPermissions; 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.CommandSource;
import me.totalfreedom.plex.command.source.RequiredCommandSource; import me.totalfreedom.plex.command.source.RequiredCommandSource;
import me.totalfreedom.plex.event.AdminAddEvent; import me.totalfreedom.plex.event.AdminAddEvent;
@ -49,8 +50,7 @@ public class AdminCMD extends PlexCommand
if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID))
{ {
sender.send(tl("playerNotFound")); throw new PlayerNotFoundException();
return;
} }
PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID);
plexPlayer.setRank(Rank.ADMIN.name()); plexPlayer.setRank(Rank.ADMIN.name());
@ -70,8 +70,7 @@ public class AdminCMD extends PlexCommand
if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID))
{ {
sender.send(tl("playerNotFound")); throw new PlayerNotFoundException();
return;
} }
PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID); PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID);
plexPlayer.setRank(""); plexPlayer.setRank("");
@ -92,8 +91,7 @@ public class AdminCMD extends PlexCommand
if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID)) if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID))
{ {
sender.send(tl("playerNotFound")); throw new PlayerNotFoundException();
return;
} }
if (!rankExists(args[2])) if (!rankExists(args[2]))