#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

@@ -45,6 +45,7 @@ import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.ServicesManager;
import org.bukkit.plugin.messaging.Messenger;
import org.bukkit.plugin.messaging.PluginMessageRecipient;
import org.bukkit.profile.PlayerProfile;
import org.bukkit.scheduler.BukkitScheduler;
import org.bukkit.scoreboard.ScoreboardManager;
import org.bukkit.structure.StructureManager;
@@ -880,6 +881,39 @@ public interface Server extends PluginMessageRecipient {
@NotNull
public OfflinePlayer getOfflinePlayer(@NotNull UUID id);
/**
* Creates a new {@link PlayerProfile}.
*
* @param uniqueId the unique id
* @param name the name
* @return the new PlayerProfile
* @throws IllegalArgumentException if both the unique id is
* <code>null</code> and the name is <code>null</code> or blank
*/
@NotNull
PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name);
/**
* Creates a new {@link PlayerProfile}.
*
* @param uniqueId the unique id
* @return the new PlayerProfile
* @throws IllegalArgumentException if the unique id is <code>null</code>
*/
@NotNull
PlayerProfile createPlayerProfile(@NotNull UUID uniqueId);
/**
* Creates a new {@link PlayerProfile}.
*
* @param name the name
* @return the new PlayerProfile
* @throws IllegalArgumentException if the name is <code>null</code> or
* blank
*/
@NotNull
PlayerProfile createPlayerProfile(@NotNull String name);
/**
* Gets a set containing all current IPs that are banned.
*