2016-03-01 00:23:45 +00:00
From 695554e3a650ccdb4d3d1d1ae56fb6bfacda48ea Mon Sep 17 00:00:00 2001
2014-07-21 20:46:54 +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
2016-02-29 21:33:06 +00:00
index e61e50b..dc2c9d1 100644
2014-07-21 20:46:54 +00:00
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
2016-02-29 21:33:06 +00:00
@@ -377,12 +377,9 @@ public final class Bukkit {
2014-11-30 22:16:48 +00:00
* <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
2014-07-21 20:46:54 +00:00
*/
- @Deprecated
public static Player getPlayer(String name) {
return server.getPlayer(name);
}
2016-02-29 21:33:06 +00:00
@@ -390,12 +387,9 @@ public final class Bukkit {
2014-07-21 20:46:54 +00:00
/**
2014-11-30 22:16:48 +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
* @param name Exact name of the player to retrieve
* @return a player object if one was found, null otherwise
2014-07-21 20:46:54 +00:00
*/
- @Deprecated
2014-11-30 22:16:48 +00:00
public static Player getPlayerExact(String name) {
return server.getPlayerExact(name);
2014-07-21 20:46:54 +00:00
}
2016-02-29 21:33:06 +00:00
@@ -407,12 +401,9 @@ public final class Bukkit {
2014-11-30 22:16:48 +00:00
* 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
2014-07-21 20:46:54 +00:00
*/
- @Deprecated
2014-11-30 22:16:48 +00:00
public static List<Player> matchPlayer(String name) {
return server.matchPlayer(name);
2014-07-21 20:46:54 +00:00
}
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
2016-02-29 21:33:06 +00:00
index 5ca4321..cdccaf3 100644
2014-07-21 20:46:54 +00:00
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
2016-02-29 21:33:06 +00:00
@@ -313,23 +313,17 @@ public interface Server extends PluginMessageRecipient {
2014-07-21 20:46:54 +00:00
* <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);
/**
2016-02-29 21:33:06 +00:00
@@ -339,12 +333,9 @@ public interface Server extends PluginMessageRecipient {
2014-07-21 20:46:54 +00:00
* 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);
/**
--
2016-02-29 21:33:06 +00:00
2.5.0
2014-07-21 20:46:54 +00:00