Interface PermSelector

All Known Implementing Classes:
AbstractRelationSelector, AbstractRoleSelector, AbstractSelector, AllSelector, FactionSelector, PlayerSelector, RelationAtLeastSelector, RelationAtMostSelector, RelationSingleSelector, RoleAtLeastSelector, RoleAtMostSelector, RoleSingleSelector, UnknownSelector

@AvailableSince("4.0.0") @NullMarked public interface PermSelector
A PermSelector tests if a given input Selectable matches or not. For example, a FPlayer might match the PlayerSelector and a Role will never match that selector but might match a RoleAtLeastSelector if it's at least that selector's value.

Implementations must be immutable and should extend AbstractSelector (or at least copy its methods to be consistent).

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Describes a type of PermSelector, and can create them.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the descriptor for this selector type.
    default net.kyori.adventure.text.Component
    Gets the name of this selector for display in chat.
    default net.kyori.adventure.text.Component
    Gets the value of this selector for display in chat.
    default String
    Serializes this selector for storage.
    Serializes the value of this selector for storage.
    boolean
    test(Selectable selectable, Faction faction)
    Tests if the given selectable matches this selector.
  • Method Details

    • descriptor

      Gets the descriptor for this selector type.
      Returns:
      descriptor
    • test

      boolean test(Selectable selectable, Faction faction)
      Tests if the given selectable matches this selector.
      Parameters:
      selectable - selectable
      faction - faction context
      Returns:
      true if matches
    • serialize

      default String serialize()
      Serializes this selector for storage. Unlikely to need to override.
      Returns:
      serialized selector
    • displayName

      default net.kyori.adventure.text.Component displayName()
      Gets the name of this selector for display in chat.
      Returns:
      display name
    • serializeValue

      String serializeValue()
      Serializes the value of this selector for storage.
      Returns:
      serialized value
    • displayValue

      default net.kyori.adventure.text.Component displayValue(Faction context)
      Gets the value of this selector for display in chat. Default is plain text without any decoration.
      Parameters:
      context - faction context
      Returns:
      display value