Class PlayerParty
- java.lang.Object
-
- de.simonsator.partyandfriends.api.party.PlayerParty
-
public abstract class PlayerParty extends java.lang.Object
Objects of this class are the party, where a player is in
-
-
Constructor Summary
Constructors Constructor Description PlayerParty()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
addPlayer(OnlinePAFPlayer pPlayer)
Adds a player to the partyprotected abstract void
addToInvited(OnlinePAFPlayer pPlayer)
protected abstract void
findNewLeader()
java.util.List<OnlinePAFPlayer>
getAllPlayers()
protected abstract java.util.List<java.util.UUID>
getInvited()
abstract int
getInviteListSize()
Returns the size of the invitation listabstract OnlinePAFPlayer
getLeader()
Gets the leader of this partyabstract java.util.List<OnlinePAFPlayer>
getPlayers()
Returns the "normal" players who are in the party.void
invite(OnlinePAFPlayer pPlayer)
Invites a player into this partyprotected abstract boolean
isAMember(OnlinePAFPlayer pPlayer)
abstract boolean
isBanned(PAFPlayer pPlayer)
boolean
isInParty(OnlinePAFPlayer pPlayer)
Returns true if the player is in the party.boolean
isInvited(OnlinePAFPlayer pPlayer)
Returns true if the player is already invited or if the party is public.boolean
isLeader(OnlinePAFPlayer player)
boolean
isLeader(PAFPlayer player)
Returns true if the given player is the leader of this party, and it will returns false if he is not the leader, of this partyboolean
isNobodyInvited()
abstract boolean
isPrivate()
void
kickPlayer(OnlinePAFPlayer pPlayer)
void
leaveParty(OnlinePAFPlayer pPlayer)
void
leaveParty(PAFPlayer pPlayer)
protected abstract boolean
needsNewLeader(PAFPlayer pPlayer)
void
removeFromInvited(OnlinePAFPlayer pPlayer)
abstract void
removeFromInvited(PAFPlayer pPlayer)
protected abstract void
removePlayerSilent(PAFPlayer pPlayer)
void
sendMessage(java.lang.String pText)
void
sendMessage(net.md_5.bungee.api.chat.TextComponent pText)
abstract void
setBanned(PAFPlayer pPlayer, boolean pIsBanned)
abstract void
setLeader(OnlinePAFPlayer player)
Sets the party leader.abstract void
setPrivateState(boolean pIsPrivate)
-
-
-
Method Detail
-
isLeader
public boolean isLeader(PAFPlayer player)
Returns true if the given player is the leader of this party, and it will returns false if he is not the leader, of this party- Parameters:
player
- The player- Returns:
- Returns a true if the given player is the leader of this party, and it will returns false if he is not the leader, of this party
-
isLeader
public boolean isLeader(OnlinePAFPlayer player)
-
isBanned
public abstract boolean isBanned(PAFPlayer pPlayer)
-
setBanned
public abstract void setBanned(PAFPlayer pPlayer, boolean pIsBanned)
-
isPrivate
public abstract boolean isPrivate()
-
setPrivateState
public abstract void setPrivateState(boolean pIsPrivate)
-
isInParty
public boolean isInParty(OnlinePAFPlayer pPlayer)
Returns true if the player is in the party. Returns false if the player is not in the party.- Parameters:
pPlayer
- The player- Returns:
- Returns true if the player is in the party. Returns false if the player is not in the party.
-
isAMember
protected abstract boolean isAMember(OnlinePAFPlayer pPlayer)
-
getInvited
protected abstract java.util.List<java.util.UUID> getInvited()
-
isNobodyInvited
public boolean isNobodyInvited()
-
getLeader
public abstract OnlinePAFPlayer getLeader()
Gets the leader of this party- Returns:
- Returns the party leader
-
setLeader
public abstract void setLeader(OnlinePAFPlayer player)
Sets the party leader.- Parameters:
player
- The player
-
getAllPlayers
public java.util.List<OnlinePAFPlayer> getAllPlayers()
- Returns:
- Returns all players in this party (inclusive the leader).
-
removePlayerSilent
protected abstract void removePlayerSilent(PAFPlayer pPlayer)
-
getPlayers
public abstract java.util.List<OnlinePAFPlayer> getPlayers()
Returns the "normal" players who are in the party.- Returns:
- Returns the "normal" players who are in the party.
-
addPlayer
public abstract boolean addPlayer(OnlinePAFPlayer pPlayer)
Adds a player to the party- Parameters:
pPlayer
- The player- Returns:
- Returns true if the player was added to this party. Returns false if the player was not added to this party
-
leaveParty
public void leaveParty(OnlinePAFPlayer pPlayer)
-
leaveParty
public void leaveParty(PAFPlayer pPlayer)
-
kickPlayer
public void kickPlayer(OnlinePAFPlayer pPlayer)
-
invite
public void invite(OnlinePAFPlayer pPlayer)
Invites a player into this party- Parameters:
pPlayer
- The player
-
removeFromInvited
public abstract void removeFromInvited(PAFPlayer pPlayer)
-
removeFromInvited
public void removeFromInvited(OnlinePAFPlayer pPlayer)
-
addToInvited
protected abstract void addToInvited(OnlinePAFPlayer pPlayer)
-
getInviteListSize
public abstract int getInviteListSize()
Returns the size of the invitation list- Returns:
- Returns the size of the invitation list
-
isInvited
public boolean isInvited(OnlinePAFPlayer pPlayer)
Returns true if the player is already invited or if the party is public. Returns false if the player is not invited.- Parameters:
pPlayer
- The player- Returns:
- Returns true if the player is already invited. Returns false if the player is not invited.
-
sendMessage
public void sendMessage(net.md_5.bungee.api.chat.TextComponent pText)
-
sendMessage
public void sendMessage(java.lang.String pText)
-
needsNewLeader
protected abstract boolean needsNewLeader(PAFPlayer pPlayer)
-
findNewLeader
protected abstract void findNewLeader()
-
-