Skip to content

Commit

Permalink
Added MCPlayer#getName
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Sep 7, 2024
1 parent 59cb221 commit 30330aa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ public UUID getUniqueId() {
return handle.getUniqueId();
}

@NotNull
@Override
public String getName() {
return handle.getName();
}

/*
* MessageReceiver implementation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ public UUID getUniqueId() {
return handle.getUniqueId();
}

@NotNull
@Override
public String getName() {
return handle.getUsername();
}

/*
* MessageReceiver implementation
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,18 @@ public interface MCPlayer<T> extends MessageReceiver {
*/
@NotNull
UUID getUniqueId();

/**
* Gets the name of this {@link MCPlayer}. Keep in mind that player
* names may change at any given time and should not be used
* for storage. {@link #getUniqueId() UUIDs} can be used for that purpose
* instead, names are only guaranteed to remain unchanged for a single session
* (Until the player logs out).
*
* @return The name of this {@link MCPlayer}.
*
* @since MCUtils 1.0.0
*/
@NotNull
String getName();
}

0 comments on commit 30330aa

Please sign in to comment.