Interface Party
-
public interface Party
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description booleanaddMember(@NotNull PartyPlayer partyPlayer)Add the player to the partyvoidbroadcastMessage(@NotNull String message, @Nullable PartyPlayer player)Send a broadcast message to the party.voidchangeLeader(@NotNull PartyPlayer leaderPartyPlayer)Change the party leadervoiddelete()Delete the partySet<PartyAskRequest>getAskRequests()Get a list of pending ask requests@Nullable PartyColorgetColor()Get the party color@Nullable StringgetDescription()Get the party descriptiondoublegetExperience()Get the party experiencedefault PartyHomegetHome()Deprecated.usegetHomes()instead@NotNull Set<PartyHome>getHomes()Get the set of homes of the party@NotNull UUIDgetId()Get the party idSet<PartyInvite>getInviteRequests()Get a list of pending invite requestsintgetKills()Get the kills number of the party@Nullable UUIDgetLeader()Get the party leaderintgetLevel()Get the current party leveldoublegetLevelExperience()Get the total experience of the current leveldoublegetLevelUpCurrent()Get the current party level experience.doublegetLevelUpNecessary()Get the experience required to level up the party@NotNull Set<UUID>getMembers()Get a list of party members.@Nullable StringgetMotd()Get the Message Of The Day of the party@Nullable StringgetName()Get the party namedefault @NotNull Set<PartyPlayer>getOnlineMembers()Get a list of online members@NotNull Set<PartyPlayer>getOnlineMembers(boolean bypassVanish)Get a list of online members@Nullable StringgetPassword()Get the party passwordbooleangetProtection()Get the party friendly fire protection@Nullable StringgetTag()Get the party tagdefault voidgiveExperience(double experience)Give party experiencevoidgiveExperience(double experience, boolean gainMessage)Give party experience.default PartyInviteinvitePlayer(@NotNull PartyPlayer partyPlayer)Invite the player into the partydefault PartyInviteinvitePlayer(@NotNull PartyPlayer partyPlayer, @Nullable PartyPlayer inviter)Invite the player into the partyPartyInviteinvitePlayer(@NotNull PartyPlayer partyPlayer, @Nullable PartyPlayer inviter, boolean sendMessages)Invite the player into the partybooleanisFixed()Is the party fixed?booleanisFollowEnabled()Check if the party have the follow option enabledbooleanisFriendlyFireProtected()Check if the party is protected from friendly fire using both command and global protection.booleanisFull()Is the party full?booleanisOpen()Is the party open to players?booleanremoveMember(@NotNull PartyPlayer partyPlayer)Remove the player from the partyvoidrename(@Nullable String newName)Rename the partyvoidsetColor(@Nullable PartyColor color)Set the party colorvoidsetDescription(@Nullable String description)Set the party descriptionvoidsetExperience(double experience)Set the party experiencevoidsetFixed(boolean fixed, @Nullable PartyPlayer newLeader)Toggle a fixed partyvoidsetFollowEnabled(boolean follow)Set the party follow optiondefault voidsetHome(@Nullable PartyHome home)Deprecated.usesetHomes(...)insteadvoidsetHomes(@NotNull Set<PartyHome> homes)Set the set of homes of the partyvoidsetKills(int kills)Set the number of kills of the partyvoidsetMotd(@Nullable String motd)Set the Message Of The Day of the partydefault voidsetName(String name)Deprecated.use rename(String)voidsetOpen(boolean open)Set the party as openvoidsetPassword(@Nullable String password)Set the party passwordbooleansetPasswordUnhashed(@Nullable String password)Set the party password unhashed, the plugin will hash itvoidsetProtection(boolean protection)Set the party friendly fire protectionvoidsetTag(@Nullable String tag)Set the party tag
-
-
-
Method Detail
-
getId
@NotNull @NotNull UUID getId()
Get the party id- Returns:
- the id of the party
-
getName
@Nullable @Nullable String getName()
Get the party name- Returns:
- the name of the party
-
delete
void delete()
Delete the party
-
rename
void rename(@Nullable @Nullable String newName)Rename the party- Parameters:
newName- the name to set
-
setName
@Deprecated default void setName(String name)
Deprecated.use rename(String)Set the party name- Parameters:
name- the name to set
-
getMembers
@NotNull @NotNull Set<UUID> getMembers()
Get a list of party members. It will contains members of every rank, leader too.- Returns:
- the members sub of the party
-
getOnlineMembers
@NotNull default @NotNull Set<PartyPlayer> getOnlineMembers()
Get a list of online members- Returns:
- an unmodifiable
Set<PartyPlayer>
-
getOnlineMembers
@NotNull @NotNull Set<PartyPlayer> getOnlineMembers(boolean bypassVanish)
Get a list of online members- Parameters:
bypassVanish- bypass player with vanish?- Returns:
- an unmodifiable
Set<PartyPlayer>
-
addMember
boolean addMember(@NotNull @NotNull PartyPlayer partyPlayer)Add the player to the party- Parameters:
partyPlayer- thePartyPlayerto add- Returns:
- true if successfully added
-
removeMember
boolean removeMember(@NotNull @NotNull PartyPlayer partyPlayer)Remove the player from the party- Parameters:
partyPlayer- thePartyPlayerto remove- Returns:
- true if successfully removed
-
getInviteRequests
Set<PartyInvite> getInviteRequests()
Get a list of pending invite requests- Returns:
- a set of
PartyInvite
-
invitePlayer
default PartyInvite invitePlayer(@NotNull @NotNull PartyPlayer partyPlayer)
Invite the player into the party- Parameters:
partyPlayer- thePartyPlayerto invite- Returns:
- the
PartyInviteinstance
-
invitePlayer
default PartyInvite invitePlayer(@NotNull @NotNull PartyPlayer partyPlayer, @Nullable @Nullable PartyPlayer inviter)
Invite the player into the party- Parameters:
partyPlayer- thePartyPlayerto inviteinviter- thePartyPlayerwho is inviting partyPlayer- Returns:
- the
PartyInviteinstance
-
invitePlayer
PartyInvite invitePlayer(@NotNull @NotNull PartyPlayer partyPlayer, @Nullable @Nullable PartyPlayer inviter, boolean sendMessages)
Invite the player into the party- Parameters:
partyPlayer- thePartyPlayerto inviteinviter- thePartyPlayerwho is inviting partyPlayersendMessages- true if the event should send messages to players- Returns:
- the
PartyInviteinstance
-
getAskRequests
Set<PartyAskRequest> getAskRequests()
Get a list of pending ask requests- Returns:
- a set of
PartyAskRequest
-
isFull
boolean isFull()
Is the party full?- Returns:
- true if the party is full
-
getLeader
@Nullable @Nullable UUID getLeader()
Get the party leader- Returns:
- the
UUIDof the party leader, can be magic if the party is fixed
-
changeLeader
void changeLeader(@NotNull @NotNull PartyPlayer leaderPartyPlayer)Change the party leader- Parameters:
leaderPartyPlayer- thePartyPlayerto promote as leader
-
isFixed
boolean isFixed()
Is the party fixed?- Returns:
- true if the party is fixed
-
setFixed
void setFixed(boolean fixed, @Nullable @Nullable PartyPlayer newLeader)Toggle a fixed party- Parameters:
fixed-trueto be fixednewLeader- new leader to set, null if setting Party as fixed
-
getTag
@Nullable @Nullable String getTag()
Get the party tag- Returns:
- the party tag
-
setTag
void setTag(@Nullable @Nullable String tag)Set the party tag- Parameters:
tag- the tag of the party
-
getDescription
@Nullable @Nullable String getDescription()
Get the party description- Returns:
- the party description
-
setDescription
void setDescription(@Nullable @Nullable String description)Set the party description- Parameters:
description- the description of the party
-
getMotd
@Nullable @Nullable String getMotd()
Get the Message Of The Day of the party- Returns:
- the MOTD of the party
-
setMotd
void setMotd(@Nullable @Nullable String motd)Set the Message Of The Day of the party- Parameters:
motd- the MOTD of the party
-
getHomes
@NotNull @NotNull Set<PartyHome> getHomes()
Get the set of homes of the party- Returns:
- the
Set<PartyHome>of the party
-
setHomes
void setHomes(@NotNull @NotNull Set<PartyHome> homes)Set the set of homes of the party- Parameters:
homes- theSet<PartyHome>of the party
-
getHome
@Deprecated default PartyHome getHome()
Deprecated.usegetHomes()instead- Returns:
- the
PartyHomeof the party
-
setHome
@Deprecated default void setHome(@Nullable @Nullable PartyHome home)
Deprecated.usesetHomes(...)instead- Parameters:
home- the new party home
-
getColor
@Nullable @Nullable PartyColor getColor()
Get the party color- Returns:
- the
Colorof the party
-
setColor
void setColor(@Nullable @Nullable PartyColor color)Set the party color- Parameters:
color- theColorof the party
-
getKills
int getKills()
Get the kills number of the party- Returns:
- the number of kills of the party
-
setKills
void setKills(int kills)
Set the number of kills of the party- Parameters:
kills- the number of kills of the party
-
isOpen
boolean isOpen()
Is the party open to players?- Returns:
- true if its open
-
setOpen
void setOpen(boolean open)
Set the party as open- Parameters:
open- true for open
-
getPassword
@Nullable @Nullable String getPassword()
Get the party password- Returns:
- the password of the party, HASHED
-
setPassword
void setPassword(@Nullable @Nullable String password)Set the party password- Parameters:
password- the password of the party, HASHED
-
setPasswordUnhashed
boolean setPasswordUnhashed(@Nullable @Nullable String password)Set the party password unhashed, the plugin will hash it- Parameters:
password- the password of the party- Returns:
- true if the password is valid
-
getProtection
boolean getProtection()
Get the party friendly fire protection- Returns:
- true if the party is protected
-
setProtection
void setProtection(boolean protection)
Set the party friendly fire protection- Parameters:
protection- true if you want protect the party
-
isFriendlyFireProtected
boolean isFriendlyFireProtected()
Check if the party is protected from friendly fire using both command and global protection. Use this if you just want to check for FF.- Returns:
- true if pvp between players is protected
-
getExperience
double getExperience()
Get the party experience- Returns:
- the total experience of the party
-
setExperience
void setExperience(double experience)
Set the party experience- Parameters:
experience- the experience number to set
-
giveExperience
default void giveExperience(double experience)
Give party experience- Parameters:
experience- the experience number to give
-
giveExperience
void giveExperience(double experience, boolean gainMessage)Give party experience. Choose to send the gain message or not.- Parameters:
experience- the experience number to givegainMessage- should the gain message be sent or not
-
getLevel
int getLevel()
Get the current party level- Returns:
- the calculated level of the party
-
getLevelExperience
double getLevelExperience()
Get the total experience of the current level- Returns:
- the total experience of the current level
-
getLevelUpCurrent
double getLevelUpCurrent()
Get the current party level experience. How many experience of the current level- Returns:
- the current level experience of the party
-
getLevelUpNecessary
double getLevelUpNecessary()
Get the experience required to level up the party- Returns:
- the experience required to level up the party
-
setFollowEnabled
void setFollowEnabled(boolean follow)
Set the party follow option- Parameters:
follow- true if you want enable follow option
-
isFollowEnabled
boolean isFollowEnabled()
Check if the party have the follow option enabled- Returns:
- true if follow option is enabled
-
broadcastMessage
void broadcastMessage(@NotNull @NotNull String message, @Nullable @Nullable PartyPlayer player)Send a broadcast message to the party. It requires a player to send the message because Parties gets the placeholder info from the player. The player can be null if its a general broadcast.- Parameters:
message- the message to broadcastplayer- thePartyPlayerwho sent the message
-
-