Interface Party


  • public interface Party
    • 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 - the PartyPlayer to add
        Returns:
        true if successfully added
      • removeMember

        boolean removeMember​(@NotNull
                             @NotNull PartyPlayer partyPlayer)
        Remove the player from the party
        Parameters:
        partyPlayer - the PartyPlayer to remove
        Returns:
        true if successfully removed
      • getInviteRequests

        Set<PartyInvite> getInviteRequests()
        Get a list of pending invite requests
        Returns:
        a set of PartyInvite
      • invitePlayer

        PartyInvite invitePlayer​(@NotNull
                                 @NotNull PartyPlayer partyPlayer,
                                 @Nullable
                                 @Nullable PartyPlayer inviter,
                                 boolean sendMessages)
        Invite the player into the party
        Parameters:
        partyPlayer - the PartyPlayer to invite
        inviter - the PartyPlayer who is inviting partyPlayer
        sendMessages - true if the event should send messages to players
        Returns:
        the PartyInvite instance
      • 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 UUID of the party leader, can be magic if the party is fixed
      • changeLeader

        void changeLeader​(@NotNull
                          @NotNull PartyPlayer leaderPartyPlayer)
        Change the party leader
        Parameters:
        leaderPartyPlayer - the PartyPlayer to 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 - true to be fixed
        newLeader - 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 - the Set<PartyHome> of the party
      • getHome

        @Deprecated
        default PartyHome getHome()
        Deprecated.
        use getHomes() instead
        Returns:
        the PartyHome of the party
      • setHome

        @Deprecated
        default void setHome​(@Nullable
                             @Nullable PartyHome home)
        Deprecated.
        use setHomes(...) instead
        Parameters:
        home - the new party home
      • getColor

        @Nullable
        @Nullable PartyColor getColor()
        Get the party color
        Returns:
        the Color of the party
      • setColor

        void setColor​(@Nullable
                      @Nullable PartyColor color)
        Set the party color
        Parameters:
        color - the Color of 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 give
        gainMessage - 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 broadcast
        player - the PartyPlayer who sent the message