2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 20 Dec 2016 15:55:55 -0500
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
2023-09-22 04:31:59 +02:00
index e12d28143a213abdc0552a15e82cacecc414ca26..3954f40b23536fec495585a8b14e82d092d62e39 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
2023-08-06 02:21:59 +02:00
@@ -1042,6 +1042,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
2021-06-11 14:02:28 +02:00
public void sendMap(@NotNull 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
2023-03-10 21:18:50 +01:00
+ * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
2021-06-11 14:02:28 +02:00
+ */
+ @Deprecated
+ public void sendActionBar(@NotNull 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
2023-03-10 21:18:50 +01:00
+ * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
2021-06-11 14:02:28 +02:00
+ */
+ @Deprecated
+ public void sendActionBar(char alternateChar, @NotNull String message);
+
+ /**
+ * Sends an Action Bar message to the client.
+ *
+ * @param message The components to send
2023-03-10 21:18:50 +01:00
+ * @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
2021-06-11 14:02:28 +02:00
+ */
+ @Deprecated
+ public void sendActionBar(@NotNull net.md_5.bungee.api.chat.BaseComponent... message);
+
/**
* Sends the component to the player
*
2023-08-06 02:21:59 +02:00
@@ -1069,9 +1102,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
2021-06-11 14:02:28 +02:00
/**
* 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);
}