Developers
The first thing to do is add the latest version of Shivtr Auth to your libraries. You will then want to get access to Shivtr Auth I recommend the code below.
private ShivtrAuth getShivtrAuth() {
Plugin plugin = getServer().getPluginManager().getPlugin("Shivtr Auth");
// Shivtr Auth may not be loaded
if (plugin == null || !(plugin instanceof ShivtrAuth)) {
return null; // Maybe you want throw an exception instead
}
return (ShivtrAuth) plugin;
}
Once you have this you will likely then want to grab the AuthenticationCore. To do this use the following code:
private AuthenticationCore auth; auth = getShivtrAuth().getAuthenticationCore();
Instead you could do more of a Vault like usage and create a void which attempts to get the AuthenticationCore. Possibly like this:
private AuthenticationCore auth;
private void setUpAuthenticationCore() {
Plugin plugin = getServer().getPluginManager().getPlugin("Shivtr Auth");
// Shivtr Auth may not be loaded
if (plugin == null || !(plugin instanceof ShivtrAuth)) {
return; // Maybe you want throw an exception instead
}
auth = ((ShivtrAuth) plugin).getAuthenticationCore();
}
Once you do this you can then use any of the following functions.
Returns true if the player is on one of the list.
isValidCharacter(player);
Updates the Characters List.
updateCharacterLists();
Comments