Add blockedit command

This commit is contained in:
2022-03-25 00:45:55 -05:00
parent 262368ed18
commit 273dd8a5ef
4 changed files with 178 additions and 2 deletions

View File

@ -274,6 +274,24 @@ public abstract class PlexCommand extends Command implements PluginIdentifiableC
return true;
}
protected boolean silentCheckRank(Player player, Rank rank, String permission)
{
if (player instanceof ConsoleCommandSender)
{
return true;
}
PlexPlayer plexPlayer = getPlexPlayer(player);
if (plugin.getSystem().equalsIgnoreCase("ranks"))
{
return plexPlayer.getRankFromString().isAtLeast(rank);
}
else if (plugin.getSystem().equalsIgnoreCase("permissions"))
{
return player.hasPermission(permission);
}
return false;
}
/**
* Checks whether a sender has enough permissions or is high enough a rank
*