#719: Add Player Profile API

Slight changes may occur as this API is stabilized.

This PR is based on work previously done by DerFrZocker in #663.

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
Bukkit/Spigot
2022-02-03 09:25:35 +11:00
parent e6392d1992
commit 7c667b37d9
7 changed files with 362 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ import org.bukkit.entity.AnimalTamer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.permissions.ServerOperator;
import org.bukkit.profile.PlayerProfile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -39,6 +40,18 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
@NotNull
public UUID getUniqueId();
/**
* Gets a copy of the player's profile.
* <p>
* If the player is online, the returned profile will be complete.
* Otherwise, only the unique id is guaranteed to be present. You can use
* {@link PlayerProfile#update()} to complete the returned profile.
*
* @return the player's profile
*/
@NotNull
PlayerProfile getPlayerProfile();
/**
* Checks if this player is banned or not
*