Interface PartiesAPI


public interface PartiesAPI
  • Method Details

    • getOptions

      PartiesOptions getOptions()
      Get main plugin options
      Returns:
      the PartiesOptions
    • reloadPlugin

      void reloadPlugin()
      Reload Parties configuration files
    • isBungeeCordEnabled

      boolean isBungeeCordEnabled()
      Check if the plugin have BungeeCord option enabled
      Returns:
      true if BungeeCord support is enabled
    • createParty

      boolean createParty(@Nullable @Nullable String party, @Nullable @Nullable PartyPlayer leader)
      Create a party
      Parameters:
      party - the party name
      leader - the leader of the party as PartyPlayer, null if the party should be fixed
      Returns:
      true if successfully created
    • getParty

      @Nullable @Nullable Party getParty(@NotNull @NotNull String party)
      Get the party by its name
      Parameters:
      party - the name of the Party
      Returns:
      the Party
    • getParty

      @Nullable @Nullable Party getParty(@NotNull @NotNull UUID party)
      Get the party by its id
      Parameters:
      party - the id of the Party
      Returns:
      the Party
    • getPartyPlayer

      @Nullable @Nullable PartyPlayer getPartyPlayer(@NotNull @NotNull UUID uuid)
      Get the player by his UUID
      Parameters:
      uuid - the UUID of the player
      Returns:
      the PartyPlayer of the relative player
    • getPartyOfPlayer

      @Nullable @Nullable Party getPartyOfPlayer(@NotNull @NotNull UUID uuid)
      Get the party of the player
      Parameters:
      uuid - the UUID of the player
      Returns:
      the Party of the relative player
    • getOnlineParties

      @NotNull @NotNull List<Party> getOnlineParties()
      Get online parties
      Returns:
      a list of Party
    • getRanks

      @NotNull @NotNull Set<PartyRank> getRanks()
      Get the list of available ranks
      Returns:
      a set of PartyRank
    • getColors

      @NotNull @NotNull Set<PartyColor> getColors()
      Get the list of available colors
      Returns:
      a set of PartyColor
    • reloadParties

      @Deprecated default void reloadParties()
      Deprecated.
      use reloadPlugin() instead
      Reload Parties configuration files
    • updateParty

      @Deprecated default void updateParty(Party party)
      Deprecated.
      no longer needed
      Send changes to the database. Used to save parties data.
      Parameters:
      party - the Party to save
    • updatePartyPlayer

      @Deprecated default void updatePartyPlayer(PartyPlayer player)
      Deprecated.
      no longer needed
      Send changes to the database. Used to save players data.
      Parameters:
      player - the PartyPlayer to save
    • broadcastPartyMessage

      @Deprecated default void broadcastPartyMessage(Party party, PartyPlayer player, String message)
      Deprecated.
      use Party.broadcastMessage(String, PartyPlayer) instead
      Send a broadcast message to the party paramParty; It requires a player to send the message because Parties gets the placeholder info from the player; If it's a broadcast unrelated on players, you can insert a null player.
      Parameters:
      party - the Party that will see the message
      player - the PartyPlayer who sent the message
      message - the message to broadcast
    • addPlayerIntoParty

      @Deprecated default Status addPlayerIntoParty(PartyPlayer player, Party party)
      Deprecated.
      use Party.addMember(PartyPlayer) instead
      Add the player into the party
      Parameters:
      player - the PartyPlayer to insert
      party - the Party
      Returns:
      the result of the method as Status
    • removePlayerFromParty

      @Deprecated default Status removePlayerFromParty(PartyPlayer player)
      Deprecated.
      use Party.removeMember(PartyPlayer) instead
      Remove the player from the party
      Parameters:
      player - the PartyPlayer to remove
      Returns:
      the result of the method as Status
    • deleteParty

      @Deprecated default Status deleteParty(Party party)
      Deprecated.
      use Party.delete() instead
      Delete the party
      Parameters:
      party - the Party to delete
      Returns:
      the Status of the method
    • getOnlinePlayers

      @Deprecated default Set<PartyPlayer> getOnlinePlayers(Party party)
      Deprecated.
      use Party.getOnlineMembers(boolean) instead
      Get a list of online players of the party
      Parameters:
      party - the Party
      Returns:
      a set of Set<PartyPlayer>, if the party doesn't exist returns null
    • refreshOnlinePlayers

      @Deprecated default void refreshOnlinePlayers(Party party)
      Deprecated.
      no longer needed
      Refresh the online players list of the party
      Parameters:
      party - the Party
    • isPlayerInParty

      default boolean isPlayerInParty(UUID player)
      Is the player in a party?
      Parameters:
      player - the player UUID to check
      Returns:
      true if its in a party
    • getPartiesListByName

      @NotNull @NotNull LinkedList<Party> getPartiesListByName(int numberOfParties, int offset)
      Get list of parties ordered by name
      Parameters:
      numberOfParties - number of parties to get
      offset - offset of parties list
      Returns:
      a list of Party
    • getPartiesListByOnlineMembers

      @NotNull @NotNull LinkedList<Party> getPartiesListByOnlineMembers(int numberOfParties, int offset)
      Get list of parties ordered by number of online members
      Parameters:
      numberOfParties - number of parties to get
      offset - offset of parties list
      Returns:
      a list of Party
    • getPartiesListByMembers

      @NotNull @NotNull LinkedList<Party> getPartiesListByMembers(int numberOfParties, int offset)
      Get list of parties ordered by number of members
      Parameters:
      numberOfParties - number of parties to get
      offset - offset of parties list
      Returns:
      a list of Party
    • getPartiesListByKills

      @NotNull @NotNull LinkedList<Party> getPartiesListByKills(int numberOfParties, int offset)
      Get list of parties ordered by number of kills
      Parameters:
      numberOfParties - number of parties to get
      offset - offset of parties list
      Returns:
      a list of Party
    • getPartiesListByExperience

      @NotNull @NotNull LinkedList<Party> getPartiesListByExperience(int numberOfParties, int offset)
      Get list of parties ordered by number of experience
      Parameters:
      numberOfParties - number of parties to get
      offset - offset of parties list
      Returns:
      a list of Party
    • areInTheSameParty

      boolean areInTheSameParty(UUID player1, UUID player2)
      Check if the given players are in the same party
      Parameters:
      player1 - the first player
      player2 - the second player
      Returns:
      true if they are in the same party