Paper/Spigot-API-Patches/0041-Add-String-based-Action-Bar-API.patch
Shane Freeder 29a01de126
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
9a793cce Remove no longer applicable caveats to setPlayerListName
7137829e SPIGOT-4496: Undeprecate MapView.getId and make int
de33ade0 Remove some draft API designations
a35fa838 SPIGOT-4472: Add Consumer scheduler methods

CraftBukkit Changes:
8cd538e6 SPIGOT-4498: Crash on startup
b4ee04ba SPIGOT-4496: Undeprecate MapView.getId and make int
ec937d0e SPIGOT-4472: Add Consumer scheduler methods

Spigot Changes:
a1f2566f Use monotonic time for watchdog
bc4adcbf SPIGOT-4498: Crash on startup
bb387e6c Rebuild patches
2018-11-24 05:28:04 +00:00

77 lines
3.5 KiB
Diff

From a8cbfca459051cee3f377582c8d5057c70a96d30 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
index a9163a5f6..d10e3f99d 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -416,6 +416,26 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
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
*
@@ -439,9 +459,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* 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);
}
@@ -1788,9 +1810,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* 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.");
}
@@ -1798,9 +1822,11 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
/**
* 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 void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
throw new UnsupportedOperationException("Not supported yet.");
}
--
2.19.1