Quick fix

This commit is contained in:
Telesphoreo 2022-04-09 00:26:34 -05:00
parent 5a352b2ca0
commit 10dd546c09

View File

@ -18,7 +18,7 @@ public class AdminListener extends PlexListener
{ {
String userSender = event.getSender().getName(); String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer(); PlexPlayer target = event.getPlexPlayer();
if (!target.getRank().isEmpty()) if (target.getRankFromString().isAtLeast(Rank.ADMIN))
{ {
PlexUtils.broadcast(messageComponent("adminReadded", userSender, target.getName(), target.getRankFromString().getReadable())); PlexUtils.broadcast(messageComponent("adminReadded", userSender, target.getName(), target.getRankFromString().getReadable()));
} }
@ -29,7 +29,6 @@ public class AdminListener extends PlexListener
} }
target.setAdminActive(true); target.setAdminActive(true);
DataUtils.update(target); DataUtils.update(target);
} }
@EventHandler @EventHandler
@ -37,7 +36,6 @@ public class AdminListener extends PlexListener
{ {
String userSender = event.getSender().getName(); String userSender = event.getSender().getName();
PlexPlayer target = event.getPlexPlayer(); PlexPlayer target = event.getPlexPlayer();
// target.setRank("");
target.setAdminActive(false); target.setAdminActive(false);
DataUtils.update(target); DataUtils.update(target);
PlexUtils.broadcast(messageComponent("adminRemoved", userSender, target.getName())); PlexUtils.broadcast(messageComponent("adminRemoved", userSender, target.getName()));