Interface Relation


public interface Relation
A read-only view of one entry in the relations ledger.

The ledger records every player ever seen online, not just friends and enemies. An entry therefore does not imply a stance: type() is null for a player who has merely been observed. Check hasRelation() before treating an entry as a friend or enemy.

Views are live: they reflect the ledger's current state, and mutations made through Relations are visible through previously obtained views.

  • Method Summary

    Modifier and Type
    Method
    Description
    long
    firstSeen(String username)
    Epoch millis when this player was first seen using username (case-insensitive), or 0 when unknown — either the name is not in the history, or it predates history tracking.
    boolean
    Whether this is a real friend/enemy rather than a passively observed player.
    default boolean
     
    default boolean
     
    The username this player is currently known by; never null, may be empty.
    The nickname shown in place of the username, or null if none is set.
    The explicit stance towards this player, or null when they have only been seen online.
    Every username this player has been seen under, oldest first.
    The player's UUID, or null if it has never been resolved.
  • Method Details

    • name

      String name()
      The username this player is currently known by; never null, may be empty.
    • uuid

      UUID uuid()
      The player's UUID, or null if it has never been resolved.
    • type

      RelationType type()
      The explicit stance towards this player, or null when they have only been seen online. Do not switch over this without a null check first.
    • hasRelation

      boolean hasRelation()
      Whether this is a real friend/enemy rather than a passively observed player.
    • isFriend

      default boolean isFriend()
    • isEnemy

      default boolean isEnemy()
    • nickname

      String nickname()
      The nickname shown in place of the username, or null if none is set.
    • usernames

      List<String> usernames()
      Every username this player has been seen under, oldest first. A username survives renames — the history is the point of the ledger.
    • firstSeen

      long firstSeen(String username)
      Epoch millis when this player was first seen using username (case-insensitive), or 0 when unknown — either the name is not in the history, or it predates history tracking.