Reworked a little Users.java

This commit is contained in:
bm01
2012-06-08 19:13:17 +02:00
parent d644b4c331
commit 90c8e57ed7
7 changed files with 80 additions and 67 deletions

View File

@@ -236,18 +236,6 @@ public class mcMMO extends JavaPlugin {
modDirectory = mainDirectory + "ModConfigs" + File.separator;
}
/**
* Get profile of the player.
* </br>
* This function is designed for API usage.
*
* @param player Player whose profile to get
* @return the PlayerProfile object
*/
public PlayerProfile getPlayerProfile(Player player) {
return Users.getProfile(player);
}
/**
* Get profile of the player by name.
* </br>
@@ -256,19 +244,19 @@ public class mcMMO extends JavaPlugin {
* @param playerName Name of player whose profile to get
* @return the PlayerProfile object
*/
public PlayerProfile getPlayerProfileByName(String playerName) {
return Users.getProfileByName(playerName);
public PlayerProfile getPlayerProfile(String playerName) {
return Users.getProfile(playerName);
}
/**
* Get profile of the offline player.
* Get profile of the player.
* </br>
* This function is designed for API usage.
*
* @param player Offline player whose profile to get
* @param player player whose profile to get
* @return the PlayerProfile object
*/
public PlayerProfile getOfflinePlayerProfile(OfflinePlayer player) {
public PlayerProfile getPlayerProfile(OfflinePlayer player) {
return Users.getProfile(player);
}
@@ -278,8 +266,8 @@ public class mcMMO extends JavaPlugin {
@Override
public void onDisable() {
//Make sure to save player information if the server shuts down
for (PlayerProfile x : Users.getProfiles().values()) {
x.save();
for (PlayerProfile playerProfile : Users.getProfiles()) {
playerProfile.save();
}
getServer().getScheduler().cancelTasks(this); //This removes our tasks