Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/Bukkit-Patches/0025-Remove-deprecation-on-some-player-lookup-methods.patch

71 Zeilen
2.6 KiB
Diff

From 6ada6b20f8e3682dd430300130b43f69c35377c4 Mon Sep 17 00:00:00 2001
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);
}
diff --git a/src/main/java/org/bukkit/OfflinePlayer.java b/src/main/java/org/bukkit/OfflinePlayer.java
index cbf8746..7da5ab6 100644
--- a/src/main/java/org/bukkit/OfflinePlayer.java
+++ b/src/main/java/org/bukkit/OfflinePlayer.java
@@ -24,7 +24,6 @@ public interface OfflinePlayer extends ServerOperator, AnimalTamer, Configuratio
* guaranteed to be unique
* @return Player name
*/
- @Deprecated
public String getName();
/**
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index d2cb517..72ef028 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -273,7 +273,6 @@ public interface Server extends PluginMessageRecipient {
* @param name the name to look up
* @return a player if one was found, null otherwise
*/
- @Deprecated
public Player getPlayer(String name);
/**
@@ -284,7 +283,6 @@ public interface Server extends PluginMessageRecipient {
* @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);
/**
@@ -299,7 +297,6 @@ public interface Server extends PluginMessageRecipient {
* @param name the (partial) name to match
* @return list of all possible players
*/
- @Deprecated
public List<Player> matchPlayer(String name);
/**
--
1.8.3.2