Add a playerIsOp helper function to ServerUtilities

This commit is contained in:
zontreck 2024-01-09 14:21:40 -07:00
parent 9cbdc6a9c1
commit 2c12935250
2 changed files with 15 additions and 1 deletions

View file

@ -82,4 +82,18 @@ public class ServerUtilities
if(LibZontreck.THE_SERVER.getPlayerList().getPlayer(ID) == null) return true;
else return false;
}
/**
* Checks if the user has operator permissions on the server
* @param ID The player ID
* @return True if the player is op
*/
public static boolean playerIsOp(UUID ID)
{
ServerPlayer player = getPlayerByID(ID.toString());
if(player.hasPermissions(player.getServer().getOperatorUserPermissionLevel()))
{
return true;
}else return false;
}
}