Add support for permissions

This commit is contained in:
Telesphoreo 2022-03-18 14:19:50 -05:00
parent c1d7d7812f
commit e5f7370853

View File

@ -34,9 +34,19 @@ public class DisguiseListener extends PlexListener
else
{
PlexPlayer plexPlayer = DataUtils.getPlayer(player.getUniqueId());
if (!plugin.getRankManager().isAdmin(plexPlayer))
if (plugin.getSystem().equalsIgnoreCase("ranks"))
{
DisguiseAPI.undisguiseToAll(player);
if (!plugin.getRankManager().isAdmin(plexPlayer))
{
DisguiseAPI.undisguiseToAll(player);
}
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
if (!player.hasPermission("plex.libsdisguises.bypass"))
{
DisguiseAPI.undisguiseToAll(player);
}
}
}
}