Package me.hackware.api.relations
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 TypeMethodDescriptionlongEpoch millis when this player was first seen usingusername(case-insensitive), or0when unknown — either the name is not in the history, or it predates history tracking.booleanWhether this is a real friend/enemy rather than a passively observed player.default booleanisEnemy()default booleanisFriend()name()The username this player is currently known by; nevernull, may be empty.nickname()The nickname shown in place of the username, ornullif none is set.type()The explicit stance towards this player, ornullwhen they have only been seen online.Every username this player has been seen under, oldest first.uuid()The player's UUID, ornullif it has never been resolved.
-
Method Details
-
name
String name()The username this player is currently known by; nevernull, may be empty. -
uuid
UUID uuid()The player's UUID, ornullif it has never been resolved. -
type
RelationType type()The explicit stance towards this player, ornullwhen they have only been seen online. Do notswitchover 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, ornullif none is set. -
usernames
Every username this player has been seen under, oldest first. A username survives renames — the history is the point of the ledger. -
firstSeen
Epoch millis when this player was first seen usingusername(case-insensitive), or0when unknown — either the name is not in the history, or it predates history tracking.
-