diff --git a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch index 98a1c9d658..af945acafe 100644 --- a/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch +++ b/Spigot-API-Patches/Add-String-based-Action-Bar-API.patch @@ -5,16 +5,71 @@ Subject: [PATCH] Add String based Action Bar API diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java -index 083e60fa..528ed6c9 100644 +index 083e60fa..28a229e0 100644 --- a/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline public void sendMap(MapView map); // Paper start ++ ++ /** ++ * Sends an Action Bar message to the client. ++ * ++ * Use Section symbols for legacy color codes to send formatting. ++ * ++ * @param message The message to send ++ */ + public void sendActionBar(String message); ++ ++ /** ++ * Sends an Action Bar message to the client. ++ * ++ * Use supplied alternative character to the section symbol to represent legacy color codes. ++ * ++ * @param alternateChar Alternate symbol such as '&' ++ * @param message The message to send ++ */ + public void sendActionBar(char alternateChar, String message); ++ /** * Sends the component to the player * +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline + /** + * Sends an array of components as a single message to the specified screen position of this player + * ++ * @deprecated This is unlikely the API you want to use. See {@link #sendActionBar(String)} for a more proper Action Bar API. This deprecated API may send unsafe items to the client. + * @param position the screen position + * @param components the components to send + */ ++ @Deprecated + public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { + spigot().sendMessage(position, components); + } +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline + /** + * Sends the component to the specified screen position of this player + * ++ * @deprecated This is unlikely the API you want to use. See {@link #sendActionBar(String)} for a more proper Action Bar API. This deprecated API may send unsafe items to the client. + * @param position the screen position + * @param component the components to send + */ ++ @Deprecated + public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent component) { + throw new UnsupportedOperationException("Not supported yet."); + } +@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline + /** + * Sends an array of components as a single message to the specified screen position of this player + * ++ * @deprecated This is unlikely the API you want to use. See {@link #sendActionBar(String)} for a more proper Action Bar API. This deprecated API may send unsafe items to the client. + * @param position the screen position +- * @param component the components to send ++ * @param components the components to send + */ ++ @Deprecated + public void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) { + throw new UnsupportedOperationException("Not supported yet."); + } -- \ No newline at end of file