geforkt von Mirrors/Paper
Add API for dealing with player UUIDs. Adds BUKKIT-5071, BUKKIT-5501
By: Travis Watkins <amaranth@ubuntu.com>
Dieser Commit ist enthalten in:
Ursprung
a742349b87
Commit
43e2fb9739
@ -182,6 +182,7 @@ public final class Bukkit {
|
||||
/**
|
||||
* @see Server#getPlayer(String name)
|
||||
*/
|
||||
@Deprecated
|
||||
public static Player getPlayer(String name) {
|
||||
return server.getPlayer(name);
|
||||
}
|
||||
@ -189,10 +190,18 @@ public final class Bukkit {
|
||||
/**
|
||||
* @see Server#matchPlayer(String name)
|
||||
*/
|
||||
@Deprecated
|
||||
public static List<Player> matchPlayer(String name) {
|
||||
return server.matchPlayer(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Server#getPlayer(java.util.UUID)
|
||||
*/
|
||||
public static Player getPlayer(UUID id) {
|
||||
return server.getPlayer(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Server#getPluginManager()
|
||||
*/
|
||||
@ -408,13 +417,22 @@ public final class Bukkit {
|
||||
/**
|
||||
* @see Server#getOfflinePlayer(String name)
|
||||
*/
|
||||
@Deprecated
|
||||
public static OfflinePlayer getOfflinePlayer(String name) {
|
||||
return server.getOfflinePlayer(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Server#getOfflinePlayer(java.util.UUID)
|
||||
*/
|
||||
public static OfflinePlayer getOfflinePlayer(UUID id) {
|
||||
return server.getOfflinePlayer(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Server#getPlayerExact(String name)
|
||||
*/
|
||||
@Deprecated
|
||||
public static Player getPlayerExact(String name) {
|
||||
return server.getPlayerExact(name);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package org.bukkit;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.configuration.serialization.ConfigurationSerializable;
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
@ -19,10 +20,20 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
|
||||
/**
|
||||
* Returns the name of this player
|
||||
*
|
||||
* @deprecated Use {@link #getUniqueId()} as player names are no longer
|
||||
* guaranteed to be unique
|
||||
* @return Player name
|
||||
*/
|
||||
@Deprecated
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* Returns the UUID of this player
|
||||
*
|
||||
* @return Player UUID
|
||||
*/
|
||||
public UUID getUniqueId();
|
||||
|
||||
/**
|
||||
* Checks if this player is banned or not
|
||||
*
|
||||
|
@ -268,17 +268,23 @@ public interface Server extends PluginMessageRecipient {
|
||||
* <p>
|
||||
* This method may not return objects for offline players.
|
||||
*
|
||||
* @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
|
||||
* guaranteed to be unique
|
||||
* @param name the name to look up
|
||||
* @return a player if one was found, null otherwise
|
||||
*/
|
||||
@Deprecated
|
||||
public Player getPlayer(String name);
|
||||
|
||||
/**
|
||||
* Gets the player with the exact given name, case insensitive.
|
||||
*
|
||||
* @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
|
||||
* guaranteed to be unique
|
||||
* @param name Exact name of the player to retrieve
|
||||
* @return a player object if one was found, null otherwise
|
||||
*/
|
||||
@Deprecated
|
||||
public Player getPlayerExact(String name);
|
||||
|
||||
/**
|
||||
@ -288,11 +294,22 @@ public interface Server extends PluginMessageRecipient {
|
||||
* This list is not sorted in any particular order. If an exact match is
|
||||
* found, the returned list will only contain a single result.
|
||||
*
|
||||
* @deprecated Use {@link #getPlayer(UUID)} as player names are no longer
|
||||
* guaranteed to be unique
|
||||
* @param name the (partial) name to match
|
||||
* @return list of all possible players
|
||||
*/
|
||||
@Deprecated
|
||||
public List<Player> matchPlayer(String name);
|
||||
|
||||
/**
|
||||
* Gets the player with the given UUID.
|
||||
*
|
||||
* @param id UUID of the player to retrieve
|
||||
* @return a player object if one was found, null otherwise
|
||||
*/
|
||||
public Player getPlayer(UUID id);
|
||||
|
||||
/**
|
||||
* Gets the plugin manager for interfacing with plugins.
|
||||
*
|
||||
@ -544,11 +561,26 @@ public interface Server extends PluginMessageRecipient {
|
||||
* This will return an object even if the player does not exist. To this
|
||||
* method, all players will exist.
|
||||
*
|
||||
* @deprecated Use {@link #getOfflinePlayer(UUID)} as player names are no
|
||||
* longer guaranteed to be unique
|
||||
* @param name the name the player to retrieve
|
||||
* @return an offline player
|
||||
*/
|
||||
@Deprecated
|
||||
public OfflinePlayer getOfflinePlayer(String name);
|
||||
|
||||
/**
|
||||
* Gets the player by the given UUID, regardless if they are offline or
|
||||
* online.
|
||||
* <p>
|
||||
* This will return an object even if the player does not exist. To this
|
||||
* method, all players will exist.
|
||||
*
|
||||
* @param id the UUID of the player to retrieve
|
||||
* @return an offline player
|
||||
*/
|
||||
public OfflinePlayer getOfflinePlayer(UUID id);
|
||||
|
||||
/**
|
||||
* Gets a set containing all current IPs that are banned.
|
||||
*
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren