Skip to content
This repository has been archived by the owner on Jun 18, 2023. It is now read-only.

Hooking into AuthTools

pavlyi1 edited this page Apr 1, 2021 · 3 revisions

API

AuthTools offers an API for performing actions and controlling them.
You can get AuthToolsApi class by importing pavlyi.authtools.AuthToolsApi.

Getting the classes

getInstance() - Gives u an whole access to the AuthTools (Main) class of the plugin.
getConfig() - Gives u an access to the Config class.
getMessages() - Gives u an whole access to the Messages class.
getMySQL() - Gives u an whole access to the MySQL backend class.
getMongoDB() - Gives u an whole access to the MongoDB backend class.
getYAMLConnection() - Gives u an whole access to the YAML backend class.
getGoogleAuthenticator() - Gives u an whole access to the GoogleAuthenticator class that is used.
getSpawnHandler() - Gives u an whole access to the Spawn class where's the lobby and spawn set.

Getting the Misc utilities.

hasAnUpdate() - Returns you a boolean status if the plugin needs an update.
isHooked() - Returns you a boolean status if the plugin is hooked into nLogin, AuthMe or API.
getUser() - Gives u an whole access to the Users class where you can set or get the settings of player.
isLogged() - Returns you a boolean status if the player is logged in.
isRegistered() - Returns you a boolean status if the player is registered.
setSpawn() - Sets a spawn on the given location.
setLobby() - Sets a lobby on the given location.
isLogged() - Returns you a boolean status if the player is logged in.
isRegistered() - Returns you a boolean status if the player is registered.

Login & Register

requireLogin() - Makes player to login only if they do have 2FA enabled.
requireRegister() - Makes player register only if they don't have 2FA enabled.

Events

AuthToolsPlayerLoggedEvent - This event calls when player log in.
AuthToolsPlayerRegisteredEvent - This event calls when player registers.
AuthToolsPlayerRecovered2FAEvent - This event calls when player recovers 2FA using /2fa recover command.

AuthTools

AuthToolsBungee

Clone this wiki locally