Made API classes 'statics'

This commit is contained in:
bm01
2012-06-06 22:03:15 +02:00
parent 290032646f
commit f876fe8d25
5 changed files with 38 additions and 27 deletions

View File

@ -7,7 +7,9 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.party.Party;
import com.gmail.nossr50.util.Users;
public class PartyAPI {
public final class PartyAPI {
private PartyAPI() {}
/**
* Get the name of the party a player is in.
@ -17,7 +19,7 @@ public class PartyAPI {
* @param player The player to check the party name of
* @return the name of the player's party
*/
public String getPartyName(Player player) {
public static String getPartyName(Player player) {
return Users.getProfile(player).getParty();
}
@ -29,7 +31,7 @@ public class PartyAPI {
* @param player The player to check
* @return true if the player is in a party, false otherwise
*/
public boolean inParty(Player player) {
public static boolean inParty(Player player) {
return Users.getProfile(player).inParty();
}
@ -42,7 +44,7 @@ public class PartyAPI {
* @param playerb The second player to check
* @return true if the two players are in the same party, false otherwise
*/
public boolean inSameParty(Player playera, Player playerb) {
public static boolean inSameParty(Player playera, Player playerb) {
return Party.getInstance().inSameParty(playera, playerb);
}
@ -53,7 +55,7 @@ public class PartyAPI {
*
* @return the list of parties.
*/
public ArrayList<String> getParties() {
public static ArrayList<String> getParties() {
return Party.getInstance().getParties();
}
@ -65,7 +67,7 @@ public class PartyAPI {
* @param player The player to add to the party
* @param partyName The party to add the player to
*/
public void addToParty(Player player, String partyName) {
public static void addToParty(Player player, String partyName) {
Party.getInstance().addToParty(player, Users.getProfile(player), partyName, false, null);
}
@ -76,7 +78,7 @@ public class PartyAPI {
*
* @param player The player to remove
*/
public void removeFromParty(Player player) {
public static void removeFromParty(Player player) {
Party.getInstance().removeFromParty(player, Users.getProfile(player));
}
@ -88,7 +90,7 @@ public class PartyAPI {
* @param partyName The party name
* @return the leader of the party
*/
public Player getPartyLeader(String partyName) {
public static Player getPartyLeader(String partyName) {
return Party.getInstance().getPartyLeader(partyName);
}
@ -100,7 +102,7 @@ public class PartyAPI {
* @param partyName The name of the party to set the leader of
* @param player The player to set as leader
*/
public void setPartyLeader(String partyName, String player) {
public static void setPartyLeader(String partyName, String player) {
Party.getInstance().setPartyLeader(partyName, player);
}
@ -112,7 +114,7 @@ public class PartyAPI {
* @param player The player to check
* @return all the players in the player's party
*/
public ArrayList<Player> getAllMembers(Player player) {
public static ArrayList<Player> getAllMembers(Player player) {
return Party.getInstance().getAllMembers(player);
}
@ -124,7 +126,7 @@ public class PartyAPI {
* @param partyName The party to check
* @return all online players in this party
*/
public ArrayList<Player> getOnlineMembers(String partyName) {
public static ArrayList<Player> getOnlineMembers(String partyName) {
return Party.getInstance().getOnlineMembers(partyName);
}
@ -136,7 +138,7 @@ public class PartyAPI {
* @param player The player to check
* @return all online players in the player's party
*/
public ArrayList<Player> getOnlineMembers(Player player) {
public static ArrayList<Player> getOnlineMembers(Player player) {
return Party.getInstance().getOnlineMembers(player);
}
}