Moved some stuff around, added a few functions to PartyAPI

This commit is contained in:
GJ
2012-03-29 16:13:43 -04:00
parent 8b4c86c8ba
commit 8bbee7fe06
8 changed files with 55 additions and 35 deletions

View File

@ -96,6 +96,7 @@ public class ExperienceAPI {
* </br>
* This function is designed for API usage.
*
* @param player The player to add levels to
* @param skillType Type of skill to add levels to
* @param levels Number of levels to add
*/
@ -115,4 +116,16 @@ public class ExperienceAPI {
public static int getLevel(Player player, SkillType skillType) {
return Users.getProfile(player).getSkillLevel(skillType);
}
/**
* Gets the power level of a player.
* </br>
* This function is designed for API usage.
*
* @param player The player to get the power level for
* @return the power level of the player
*/
public static int getPowerLevel(Player player) {
return Users.getProfile(player).getPowerLevel();
}
}

View File

@ -8,6 +8,7 @@ import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.gmail.nossr50.Users;
import com.gmail.nossr50.party.Party;
public class PartyAPI {
@ -45,12 +46,7 @@ public class PartyAPI {
* @return true if the two players are in the same party, false otherwise
*/
public static boolean inSameParty(Player playera, Player playerb) {
if (inParty(playera) && inParty(playerb) && getPartyName(playera).equals(getPartyName(playerb))) {
return true;
}
else {
return false;
}
return Party.getInstance().inSameParty(playera, playerb);
}
/**
@ -91,4 +87,18 @@ public class PartyAPI {
}
return parties;
}
/**
* Get a list of all players in this player's party.
* </br>
* This function is designed for API usage.
*
* @param player The player to check
* @return all the players in the player's party
*/
public static ArrayList<Player> getPartyMembers(Player player) {
return Party.getInstance().getPartyMembers(player);
}
}