Interface IPlayerPartySystemAPI<P>

Type Parameters:
P - the type of parties in the implemented system
All Known Subinterfaces:
IPlayerPartySystemAPI<P>

public interface IPlayerPartySystemAPI<P>
The interface to be overridden by addons that wish to implement additional party systems to be used by Open Parties and Claims (just the claiming feature as of writing this).

Player position synchronization is a part of the default party system. Similar functionality should be implemented in other party systems and supported separately by the map mods that display party members. OPAC does not synchronize or provide party member/ally positions from other party systems, even if they're implemented using this interface.

Party system implementations must be registered in IPlayerPartySystemRegisterAPI.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if a player is permitted to create player groups in the party's claims config (the party owner's config).
    boolean
    Checks if a player is permitted to edit the party's claims config (the party owner's config).
    boolean
    Checks if a player is permitted to include/exclude player groups in other player groups in the party's claims config (the party owner's config).
    boolean
    Checks if a player is permitted to include/exclude players in player groups in the party's claims config (the party owner's config).
    default int
    getColor(P party)
    Gets the RGB color (no alpha channel) of a specified party, e.g.
    int
    Gets the member count of a specified party.
    net.minecraft.network.chat.Component
    getName(P party)
    Gets the display name of a specified party.
    getOwner(P party)
    Gets the UUID of the owner of a specified party.
    Gets the party that the player with a specified UUID is a part of.
    Gets the party that the player with a specified UUID owns.
    boolean
    Checks if a player is permitted to claim as the party that they belong to but don't own.
    boolean
    isPlayerAllying(UUID playerId, UUID potentialAllyPlayerId)
    Checks if a player with UUID playerId considers a player with UUID potentialAllyPlayerId an ally.
  • Method Details

    • getPartyByOwner

      @Nullable P getPartyByOwner(@Nonnull UUID playerId)
      Gets the party that the player with a specified UUID owns.
      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      the party that the player owns, null if the player doesn't own one
    • getPartyByMember

      @Nullable P getPartyByMember(@Nonnull UUID playerId)
      Gets the party that the player with a specified UUID is a part of.
      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      the party that the player is in, null if the player isn't in one
    • isPlayerAllying

      boolean isPlayerAllying(@Nonnull UUID playerId, @Nonnull UUID potentialAllyPlayerId)
      Checks if a player with UUID playerId considers a player with UUID potentialAllyPlayerId an ally.
      Parameters:
      playerId - the UUID of the player to check the allies of, not null
      potentialAllyPlayerId - the UUID of the player to check the ally status of, not null
      Returns:
      true, if playerId considers potentialAllyPlayerId an ally, otherwise false
    • isPermittedToPartyClaim

      boolean isPermittedToPartyClaim(@Nonnull UUID playerId)
      Checks if a player is permitted to claim as the party that they belong to but don't own.

      This is not used by Open Parties and Claims as of writing this.

      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      true, if the player is permitted to claim as the party, otherwise false
    • canEditPartyConfig

      boolean canEditPartyConfig(@Nonnull UUID playerId)
      Checks if a player is permitted to edit the party's claims config (the party owner's config).
      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      true, if the player is permitted to edit the party's claims config, otherwise false
    • canCreatePartyConfigGroups

      boolean canCreatePartyConfigGroups(@Nonnull UUID playerId)
      Checks if a player is permitted to create player groups in the party's claims config (the party owner's config).
      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      true, if the player is permitted to create player groups, otherwise false
    • canIncludeGroupsInPartyConfigGroups

      boolean canIncludeGroupsInPartyConfigGroups(@Nonnull UUID playerId)
      Checks if a player is permitted to include/exclude player groups in other player groups in the party's claims config (the party owner's config).
      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      true, if the player is permitted to include/exclude player groups in other player groups, otherwise false
    • canIncludePlayersInPartyConfigGroups

      boolean canIncludePlayersInPartyConfigGroups(@Nonnull UUID playerId)
      Checks if a player is permitted to include/exclude players in player groups in the party's claims config (the party owner's config).
      Parameters:
      playerId - the UUID of the player, not null
      Returns:
      true, if the player is permitted to include/exclude player groups in other player groups, otherwise false
    • getOwner

      @Nullable UUID getOwner(@Nonnull P party)
      Gets the UUID of the owner of a specified party.
      Parameters:
      party - the party the owner of which will be returned, not null
      Returns:
      the UUID of the party owner, null if the party has no owner (things won't work!)
    • getName

      @Nullable net.minecraft.network.chat.Component getName(@Nonnull P party)
      Gets the display name of a specified party.
      Parameters:
      party - the party the display name of which will be returned, not null
      Returns:
      the party display name as a Component, null if the party doesn't have one
    • getMemberCount

      int getMemberCount(@Nonnull P party)
      Gets the member count of a specified party.
      Parameters:
      party - the party the member count of which will be returned, not null
      Returns:
      the member count of the party
    • getColor

      default int getColor(@Nonnull P party)
      Gets the RGB color (no alpha channel) of a specified party, e.g. 0x00FFFFFF for white. Party systems that don't support party colors should not override this.
      Parameters:
      party - the party, not null
      Returns:
      the color assigned to the party, -1 if this party system doesn't support colors