mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-04 14:12:20 -07:00
#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:
@@ -44,6 +44,7 @@ import org.bukkit.permissions.Permissible;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.ServicesManager;
|
||||
import org.bukkit.plugin.messaging.Messenger;
|
||||
import org.bukkit.profile.PlayerProfile;
|
||||
import org.bukkit.scheduler.BukkitScheduler;
|
||||
import org.bukkit.scoreboard.ScoreboardManager;
|
||||
import org.bukkit.structure.StructureManager;
|
||||
@@ -1048,6 +1049,45 @@ public final class Bukkit {
|
||||
return server.getOfflinePlayer(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
|
||||
public static PlayerProfile createPlayerProfile(@Nullable UUID uniqueId, @Nullable String name) {
|
||||
return server.createPlayerProfile(uniqueId, 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
|
||||
public static PlayerProfile createPlayerProfile(@NotNull UUID uniqueId) {
|
||||
return server.createPlayerProfile(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
|
||||
public static PlayerProfile createPlayerProfile(@NotNull String name) {
|
||||
return server.createPlayerProfile(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a set containing all current IPs that are banned.
|
||||
*
|
||||
|
Reference in New Issue
Block a user