#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:
parent
e6392d1992
commit
7c667b37d9
7 changed files with 362 additions and 0 deletions
|
@ -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.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue