Interface XPrisonGangsAPI


public interface XPrisonGangsAPI
API for interacting with the Gangs system in the XPrison plugin. Provides methods to retrieve, create, disband, and validate gangs, as well as access gang membership information.
  • Method Details

    • getPlayerGang

      Optional<Gang> getPlayerGang(org.bukkit.OfflinePlayer player)
      Retrieves the gang associated with the specified player, if any.
      Parameters:
      player - the OfflinePlayer whose gang membership is to be queried
      Returns:
      an Optional containing the player's Gang, or empty if the player is not in a gang
    • getByName

      Optional<Gang> getByName(String name)
      Retrieves a gang by its name, if it exists.
      Parameters:
      name - the name of the gang
      Returns:
      an Optional containing the Gang, or empty if no gang with that name exists
    • getAllGangs

      Collection<Gang> getAllGangs()
      Returns a collection of all registered gangs.
      Returns:
      a Collection of all Gangs
    • createGang

      GangCreateResult createGang(String name, org.bukkit.entity.Player gangLeader)
      Attempts to create a new gang with the specified name and leader.
      Parameters:
      name - the desired name of the gang
      gangLeader - the Player who will become the leader of the gang
      Returns:
      a GangCreateResult indicating the result of the creation attempt
    • disbandGang

      void disbandGang(Gang gang)
      Disbands the specified gang if it exists. All gang members will be removed and the gang will be deleted.
      Parameters:
      gang - the Gang to disband
    • checkGangName

      GangNameCheckResult checkGangName(String name)
      Checks whether a given gang name is valid and can be used.
      Parameters:
      name - the proposed gang name
      Returns:
      a GangNameCheckResult indicating if the name is valid or why it is not