Prepare the project for javadocs
This commit is contained in:
@@ -14,6 +14,8 @@ import fr.xephi.authme.cache.backup.JsonCache;
|
||||
import fr.xephi.authme.events.ResetInventoryEvent;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class LimboCache {
|
||||
|
||||
private volatile static LimboCache singleton;
|
||||
@@ -21,12 +23,20 @@ public class LimboCache {
|
||||
private JsonCache playerData;
|
||||
public AuthMe plugin;
|
||||
|
||||
/**
|
||||
* Constructor for LimboCache.
|
||||
* @param plugin AuthMe
|
||||
*/
|
||||
private LimboCache(AuthMe plugin) {
|
||||
this.plugin = plugin;
|
||||
this.cache = new ConcurrentHashMap<>();
|
||||
this.playerData = new JsonCache();
|
||||
}
|
||||
|
||||
/**
|
||||
* Method addLimboPlayer.
|
||||
* @param player Player
|
||||
*/
|
||||
public void addLimboPlayer(Player player) {
|
||||
String name = player.getName().toLowerCase();
|
||||
Location loc = player.getLocation();
|
||||
@@ -75,22 +85,45 @@ public class LimboCache {
|
||||
cache.put(name, new LimboPlayer(name, loc, gameMode, operator, playerGroup, flying));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method addLimboPlayer.
|
||||
* @param player Player
|
||||
* @param group String
|
||||
*/
|
||||
public void addLimboPlayer(Player player, String group) {
|
||||
cache.put(player.getName().toLowerCase(), new LimboPlayer(player.getName().toLowerCase(), group));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method deleteLimboPlayer.
|
||||
* @param name String
|
||||
*/
|
||||
public void deleteLimboPlayer(String name) {
|
||||
cache.remove(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLimboPlayer.
|
||||
* @param name String
|
||||
* @return LimboPlayer
|
||||
*/
|
||||
public LimboPlayer getLimboPlayer(String name) {
|
||||
return cache.get(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method hasLimboPlayer.
|
||||
* @param name String
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean hasLimboPlayer(String name) {
|
||||
return cache.containsKey(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getInstance.
|
||||
* @return LimboCache
|
||||
*/
|
||||
public static LimboCache getInstance() {
|
||||
if (singleton == null) {
|
||||
singleton = new LimboCache(AuthMe.getInstance());
|
||||
@@ -98,6 +131,10 @@ public class LimboCache {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method updateLimboPlayer.
|
||||
* @param player Player
|
||||
*/
|
||||
public void updateLimboPlayer(Player player) {
|
||||
if (this.hasLimboPlayer(player.getName().toLowerCase())) {
|
||||
this.deleteLimboPlayer(player.getName().toLowerCase());
|
||||
|
||||
@@ -4,6 +4,8 @@ import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class LimboPlayer {
|
||||
|
||||
private String name;
|
||||
@@ -15,6 +17,15 @@ public class LimboPlayer {
|
||||
private String group = "";
|
||||
private boolean flying = false;
|
||||
|
||||
/**
|
||||
* Constructor for LimboPlayer.
|
||||
* @param name String
|
||||
* @param loc Location
|
||||
* @param gameMode GameMode
|
||||
* @param operator boolean
|
||||
* @param group String
|
||||
* @param flying boolean
|
||||
*/
|
||||
public LimboPlayer(String name, Location loc, GameMode gameMode,
|
||||
boolean operator, String group, boolean flying) {
|
||||
this.name = name;
|
||||
@@ -25,51 +36,96 @@ public class LimboPlayer {
|
||||
this.flying = flying;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for LimboPlayer.
|
||||
* @param name String
|
||||
* @param group String
|
||||
*/
|
||||
public LimboPlayer(String name, String group) {
|
||||
this.name = name;
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getName.
|
||||
* @return String
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getLoc.
|
||||
* @return Location
|
||||
*/
|
||||
public Location getLoc() {
|
||||
return loc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getGameMode.
|
||||
* @return GameMode
|
||||
*/
|
||||
public GameMode getGameMode() {
|
||||
return gameMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getOperator.
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getGroup.
|
||||
* @return String
|
||||
*/
|
||||
public String getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setTimeoutTaskId.
|
||||
* @param i BukkitTask
|
||||
*/
|
||||
public void setTimeoutTaskId(BukkitTask i) {
|
||||
if (this.timeoutTaskId != null)
|
||||
this.timeoutTaskId.cancel();
|
||||
this.timeoutTaskId = i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getTimeoutTaskId.
|
||||
* @return BukkitTask
|
||||
*/
|
||||
public BukkitTask getTimeoutTaskId() {
|
||||
return timeoutTaskId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method setMessageTaskId.
|
||||
* @param messageTaskId BukkitTask
|
||||
*/
|
||||
public void setMessageTaskId(BukkitTask messageTaskId) {
|
||||
if (this.messageTaskId != null)
|
||||
this.messageTaskId.cancel();
|
||||
this.messageTaskId = messageTaskId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method getMessageTaskId.
|
||||
* @return BukkitTask
|
||||
*/
|
||||
public BukkitTask getMessageTaskId() {
|
||||
return messageTaskId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method isFlying.
|
||||
* @return boolean
|
||||
*/
|
||||
public boolean isFlying() {
|
||||
return flying;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user