Make the isSeniorAdmin() check the rank of Discord Command Senders since they're always verified

This commit is contained in:
Business Goose 2022-03-28 17:59:14 +01:00
parent 7830831111
commit 0203f05ad0
No known key found for this signature in database
GPG key ID: 77DCA801362E9645

View file

@ -9,6 +9,8 @@ import me.StevenLawson.TotalFreedomMod.config.Configuration;
import me.StevenLawson.TotalFreedomMod.config.ConfigurationEntry;
import me.StevenLawson.TotalFreedomMod.config.MainConfig;
import me.StevenLawson.TotalFreedomMod.deprecated.twitter.TwitterHandler;
import me.StevenLawson.TotalFreedomMod.discord.sender.DiscordCommandSender;
import me.StevenLawson.TotalFreedomMod.player.PlayerRank;
import me.StevenLawson.TotalFreedomMod.player.UUIDManager;
import me.StevenLawson.TotalFreedomMod.util.Utilities;
import me.StevenLawson.TotalFreedomMod.world.AdminWorld;
@ -481,6 +483,14 @@ public class AdminList
|| (MainConfig.getBoolean(ConfigurationEntry.CONSOLE_IS_SENIOR) && sender.getName().equals("CONSOLE"));
}
if(sender instanceof DiscordCommandSender) {
PlayerRank rank = PlayerRank.fromSender(sender);
if(rank.equals(PlayerRank.SENIOR)) {
return true;
}
}
final Admin entry = getEntry((Player) sender);
if (entry != null)
{