Add missing deprecation (#8886)

This commit is contained in:
Lulu13022002 2023-09-21 10:35:38 +02:00 committed by GitHub
parent 1b1c23010a
commit 3fd1502717
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 176 additions and 50 deletions

View file

@ -2133,7 +2133,7 @@ index f3afe67f0832cb828d25be3654518ff73a80b0e1..598abaa82c634178043a29f6caa6ac52
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f90365c05807 100644
index 3d84a75a6999129353a9ead48f9db25bc80f685b..e5a54a2f35d83f8c7a5f2b6512b86481aa7f9f51 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -51,7 +51,41 @@ import org.jetbrains.annotations.Nullable;
@ -2471,19 +2471,27 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component)}
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1358,6 +1570,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1327,6 +1539,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
+ @Deprecated // Paper
public void setResourcePack(@NotNull String url, @Nullable byte[] hash);
/**
@@ -1358,6 +1571,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], Component, boolean)}
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1371,8 +1584,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1371,8 +1585,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
@ -2541,7 +2549,15 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
/**
* Request that the player's client download and switch resource packs.
* <p>
@@ -1462,8 +1724,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1447,6 +1710,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* pack correctly.
* </ul>
*
+ * @deprecated in favour of {@link #setResourcePack(String, byte[], net.kyori.adventure.text.Component, boolean)}
* @param url The URL from which the client will download the resource
* pack. The string must contain only US-ASCII characters and should
* be encoded as per RFC 1738.
@@ -1462,8 +1726,57 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @throws IllegalArgumentException Thrown if the hash is not 20 bytes
* long.
*/
@ -2599,7 +2615,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
/**
* Gets the Scoreboard displayed to this player
*
@@ -1598,7 +1909,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1598,7 +1911,7 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param title Title text
* @param subtitle Subtitle text
@ -2608,7 +2624,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
*/
@Deprecated
public void sendTitle(@Nullable String title, @Nullable String subtitle);
@@ -1617,7 +1928,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1617,7 +1930,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param fadeIn time in ticks for titles to fade in. Defaults to 10.
* @param stay time in ticks for titles to stay. Defaults to 70.
* @param fadeOut time in ticks for titles to fade out. Defaults to 20.
@ -2618,7 +2634,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
public void sendTitle(@Nullable String title, @Nullable String subtitle, int fadeIn, int stay, int fadeOut);
/**
@@ -1844,6 +2157,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1844,6 +2159,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public int getClientViewDistance();
@ -2633,7 +2649,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
/**
* Gets the player's estimated ping in milliseconds.
*
@@ -1869,8 +2190,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1869,8 +2192,10 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* they wish.
*
* @return the player's locale
@ -2644,7 +2660,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
public String getLocale();
/**
@@ -1922,6 +2245,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1922,6 +2247,14 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
public boolean isAllowingServerListings();
@ -2659,7 +2675,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
// Spigot start
public class Spigot extends Entity.Spigot {
@@ -1953,11 +2284,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1953,11 +2286,13 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
throw new UnsupportedOperationException("Not supported yet.");
}
@ -2673,7 +2689,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
@Override
public void sendMessage(@NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
@@ -1968,7 +2301,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1968,7 +2303,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param component the components to send
@ -2683,7 +2699,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1978,7 +2313,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1978,7 +2315,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*
* @param position the screen position
* @param components the components to send
@ -2693,7 +2709,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @NotNull net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -1989,7 +2326,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -1989,7 +2328,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param component the components to send
@ -2703,7 +2719,7 @@ index 3d84a75a6999129353a9ead48f9db25bc80f685b..a5010cb46aa5ef69c559ef9fc717f903
public void sendMessage(@NotNull net.md_5.bungee.api.ChatMessageType position, @Nullable java.util.UUID sender, @NotNull net.md_5.bungee.api.chat.BaseComponent component) {
throw new UnsupportedOperationException("Not supported yet.");
}
@@ -2000,7 +2339,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
@@ -2000,7 +2341,9 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
* @param position the screen position
* @param sender the sender of the message
* @param components the components to send