Prepare the project for javadocs
This commit is contained in:
@@ -15,11 +15,17 @@ import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class API {
|
||||
|
||||
public static final String newline = System.getProperty("line.separator");
|
||||
public static AuthMe instance;
|
||||
|
||||
/**
|
||||
* Constructor for API.
|
||||
* @param instance AuthMe
|
||||
*/
|
||||
@Deprecated
|
||||
public API(AuthMe instance) {
|
||||
API.instance = instance;
|
||||
@@ -28,8 +34,8 @@ public class API {
|
||||
/**
|
||||
* Hook into AuthMe
|
||||
*
|
||||
* @return AuthMe instance
|
||||
*/
|
||||
|
||||
* @return AuthMe instance */
|
||||
@Deprecated
|
||||
public static AuthMe hookAuthMe() {
|
||||
if (instance != null)
|
||||
@@ -42,6 +48,10 @@ public class API {
|
||||
return instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getPlugin.
|
||||
* @return AuthMe
|
||||
*/
|
||||
@Deprecated
|
||||
public AuthMe getPlugin() {
|
||||
return instance;
|
||||
@@ -50,8 +60,8 @@ public class API {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is authenticate
|
||||
*/
|
||||
|
||||
* @return true if player is authenticate */
|
||||
@Deprecated
|
||||
public static boolean isAuthenticated(Player player) {
|
||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||
@@ -60,8 +70,8 @@ public class API {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
|
||||
* @return true if player is a npc */
|
||||
@Deprecated
|
||||
public boolean isaNPC(Player player) {
|
||||
return Utils.isNPC(player);
|
||||
@@ -70,8 +80,8 @@ public class API {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
|
||||
* @return true if player is a npc */
|
||||
@Deprecated
|
||||
public boolean isNPC(Player player) {
|
||||
return Utils.isNPC(player);
|
||||
@@ -80,13 +90,18 @@ public class API {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if the player is unrestricted
|
||||
*/
|
||||
|
||||
* @return true if the player is unrestricted */
|
||||
@Deprecated
|
||||
public static boolean isUnrestricted(Player player) {
|
||||
return Utils.isUnrestricted(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLastLocation.
|
||||
* @param player Player
|
||||
* @return Location
|
||||
*/
|
||||
@Deprecated
|
||||
public static Location getLastLocation(Player player) {
|
||||
try {
|
||||
@@ -104,6 +119,12 @@ public class API {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setPlayerInventory.
|
||||
* @param player Player
|
||||
* @param content ItemStack[]
|
||||
* @param armor ItemStack[]
|
||||
*/
|
||||
@Deprecated
|
||||
public static void setPlayerInventory(Player player, ItemStack[] content,
|
||||
ItemStack[] armor) {
|
||||
@@ -117,8 +138,8 @@ public class API {
|
||||
/**
|
||||
*
|
||||
* @param playerName
|
||||
* @return true if player is registered
|
||||
*/
|
||||
|
||||
* @return true if player is registered */
|
||||
@Deprecated
|
||||
public static boolean isRegistered(String playerName) {
|
||||
String player = playerName.toLowerCase();
|
||||
@@ -126,10 +147,11 @@ public class API {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String
|
||||
* playerName, String passwordToCheck
|
||||
* @return true if the password is correct , false else
|
||||
*/
|
||||
|
||||
|
||||
* @param playerName String
|
||||
* @param passwordToCheck String
|
||||
* @return true if the password is correct , false else */
|
||||
@Deprecated
|
||||
public static boolean checkPassword(String playerName,
|
||||
String passwordToCheck) {
|
||||
@@ -147,10 +169,11 @@ public class API {
|
||||
/**
|
||||
* Register a player
|
||||
*
|
||||
* @param String
|
||||
* playerName, String password
|
||||
* @return true if the player is register correctly
|
||||
*/
|
||||
|
||||
|
||||
* @param playerName String
|
||||
* @param password String
|
||||
* @return true if the player is register correctly */
|
||||
@Deprecated
|
||||
public static boolean registerPlayer(String playerName, String password) {
|
||||
try {
|
||||
@@ -172,8 +195,8 @@ public class API {
|
||||
/**
|
||||
* Force a player to login
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
|
||||
* @param player * player
|
||||
*/
|
||||
@Deprecated
|
||||
public static void forceLogin(Player player) {
|
||||
|
||||
@@ -15,16 +15,26 @@ import fr.xephi.authme.security.PasswordSecurity;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class NewAPI {
|
||||
|
||||
public static final String newline = System.getProperty("line.separator");
|
||||
public static NewAPI singleton;
|
||||
public AuthMe plugin;
|
||||
|
||||
/**
|
||||
* Constructor for NewAPI.
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
public NewAPI(AuthMe plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for NewAPI.
|
||||
* @param serv Server
|
||||
*/
|
||||
public NewAPI(Server serv) {
|
||||
this.plugin = (AuthMe) serv.getPluginManager().getPlugin("AuthMe");
|
||||
}
|
||||
@@ -32,8 +42,8 @@ public class NewAPI {
|
||||
/**
|
||||
* Hook into AuthMe
|
||||
*
|
||||
* @return AuthMe plugin
|
||||
*/
|
||||
|
||||
* @return AuthMe plugin */
|
||||
public static NewAPI getInstance() {
|
||||
if (singleton != null)
|
||||
return singleton;
|
||||
@@ -46,6 +56,10 @@ public class NewAPI {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getPlugin.
|
||||
* @return AuthMe
|
||||
*/
|
||||
public AuthMe getPlugin() {
|
||||
return plugin;
|
||||
}
|
||||
@@ -53,8 +67,8 @@ public class NewAPI {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is authenticate
|
||||
*/
|
||||
|
||||
* @return true if player is authenticate */
|
||||
public boolean isAuthenticated(Player player) {
|
||||
return PlayerCache.getInstance().isAuthenticated(player.getName());
|
||||
}
|
||||
@@ -62,8 +76,8 @@ public class NewAPI {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if player is a npc
|
||||
*/
|
||||
|
||||
* @return true if player is a npc */
|
||||
public boolean isNPC(Player player) {
|
||||
return Utils.isNPC(player);
|
||||
}
|
||||
@@ -71,12 +85,17 @@ public class NewAPI {
|
||||
/**
|
||||
*
|
||||
* @param player
|
||||
* @return true if the player is unrestricted
|
||||
*/
|
||||
|
||||
* @return true if the player is unrestricted */
|
||||
public boolean isUnrestricted(Player player) {
|
||||
return Utils.isUnrestricted(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLastLocation.
|
||||
* @param player Player
|
||||
* @return Location
|
||||
*/
|
||||
public Location getLastLocation(Player player) {
|
||||
try {
|
||||
PlayerAuth auth = PlayerCache.getInstance().getAuth(player.getName().toLowerCase());
|
||||
@@ -95,18 +114,19 @@ public class NewAPI {
|
||||
/**
|
||||
*
|
||||
* @param playerName
|
||||
* @return true if player is registered
|
||||
*/
|
||||
|
||||
* @return true if player is registered */
|
||||
public boolean isRegistered(String playerName) {
|
||||
String player = playerName.toLowerCase();
|
||||
return plugin.database.isAuthAvailable(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param String
|
||||
* playerName, String passwordToCheck
|
||||
* @return true if the password is correct , false else
|
||||
*/
|
||||
|
||||
|
||||
* @param playerName String
|
||||
* @param passwordToCheck String
|
||||
* @return true if the password is correct , false else */
|
||||
public boolean checkPassword(String playerName, String passwordToCheck) {
|
||||
if (!isRegistered(playerName))
|
||||
return false;
|
||||
@@ -122,10 +142,11 @@ public class NewAPI {
|
||||
/**
|
||||
* Register a player
|
||||
*
|
||||
* @param String
|
||||
* playerName, String password
|
||||
* @return true if the player is register correctly
|
||||
*/
|
||||
|
||||
|
||||
* @param playerName String
|
||||
* @param password String
|
||||
* @return true if the player is register correctly */
|
||||
public boolean registerPlayer(String playerName, String password) {
|
||||
try {
|
||||
String name = playerName.toLowerCase();
|
||||
@@ -143,8 +164,8 @@ public class NewAPI {
|
||||
/**
|
||||
* Force a player to login
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
|
||||
* @param player * player
|
||||
*/
|
||||
public void forceLogin(Player player) {
|
||||
plugin.management.performLogin(player, "dontneed", true);
|
||||
@@ -153,8 +174,8 @@ public class NewAPI {
|
||||
/**
|
||||
* Force a player to logout
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
|
||||
* @param player * player
|
||||
*/
|
||||
public void forceLogout(Player player)
|
||||
{
|
||||
@@ -164,10 +185,10 @@ public class NewAPI {
|
||||
/**
|
||||
* Force a player to register
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
* @param String
|
||||
* password
|
||||
|
||||
|
||||
* @param player * player
|
||||
* @param password String
|
||||
*/
|
||||
public void forceRegister(Player player, String password)
|
||||
{
|
||||
@@ -177,8 +198,8 @@ public class NewAPI {
|
||||
/**
|
||||
* Force a player to unregister
|
||||
*
|
||||
* @param Player
|
||||
* player
|
||||
|
||||
* @param player * player
|
||||
*/
|
||||
public void forceUnregister(Player player)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user