2014-04-02 06:51:23 +00:00
From e82a54ab86950b4d22601fc3bda15c2df118142c Mon Sep 17 00:00:00 2001
2014-03-30 04:58:32 +00:00
From: md_5 <git@md-5.net>
Date: Sun, 30 Mar 2014 15:58:22 +1100
Subject: [PATCH] Remove deprecation on some player lookup methods
Most of these methods still have plenty of use given that only one player with each name can exist at a time. Deprecating these methods renders even basic functionality such as /msg <name> impossible without causing compiler warnings. We will maintain this API and it should be considered safe and appropriate for most use cases.
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index 6b9c9f3..7d8736e 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -182,7 +182,6 @@ public final class Bukkit {
/**
* @see Server#getPlayer(String name)
*/
- @Deprecated
public static Player getPlayer(String name) {
return server.getPlayer(name);
}
@@ -190,7 +189,6 @@ public final class Bukkit {
/**
* @see Server#matchPlayer(String name)
*/
- @Deprecated
public static List<Player> matchPlayer(String name) {
return server.matchPlayer(name);
}
2014-03-30 09:15:56 +00:00
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
2014-04-02 06:51:23 +00:00
index cbf8746..d726cd6 100644
2014-03-30 09:15:56 +00:00
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
2014-04-02 06:51:23 +00:00
@@ -20,11 +20,8 @@ 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
2014-03-30 09:15:56 +00:00
* @return Player name
*/
- @Deprecated
public String getName();
/**
2014-03-30 04:58:32 +00:00
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
2014-04-02 06:51:23 +00:00
index d2cb517..d745dfb 100644
2014-03-30 04:58:32 +00:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
2014-04-02 06:51:23 +00:00
@@ -268,23 +268,17 @@ 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
2014-03-30 04:58:32 +00:00
* @param name the name to look up
* @return a player if one was found, null otherwise
*/
- @Deprecated
public Player getPlayer(String name);
/**
2014-04-02 06:51:23 +00:00
* 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
2014-03-30 04:58:32 +00:00
* @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);
/**
2014-04-02 06:51:23 +00:00
@@ -294,12 +288,9 @@ 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
2014-03-30 04:58:32 +00:00
* @param name the (partial) name to match
* @return list of all possible players
*/
- @Deprecated
public List<Player> matchPlayer(String name);
/**
--
1.8.3.2