mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Add String based Action Bar API
This commit is contained in:
parent
8da0c13f67
commit
e5e56e1ee1
1 changed files with 35 additions and 0 deletions
|
@ -1255,6 +1255,39 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||||
public void sendMap(@NotNull MapView map);
|
public void sendMap(@NotNull MapView map);
|
||||||
|
|
||||||
// Paper start
|
// 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
|
||||||
|
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
|
||||||
|
*/
|
||||||
|
@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
|
||||||
|
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public void sendActionBar(char alternateChar, @NotNull String message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends an Action Bar message to the client.
|
||||||
|
*
|
||||||
|
* @param message The components to send
|
||||||
|
* @deprecated use {@link #sendActionBar(net.kyori.adventure.text.Component)}
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public void sendActionBar(@NotNull net.md_5.bungee.api.chat.BaseComponent... message);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends the component to the player
|
* Sends the component to the player
|
||||||
*
|
*
|
||||||
|
@ -1282,9 +1315,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
|
* 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 position the screen position
|
||||||
* @param components the components to send
|
* @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) {
|
public default void sendMessage(net.md_5.bungee.api.ChatMessageType position, net.md_5.bungee.api.chat.BaseComponent... components) {
|
||||||
spigot().sendMessage(position, components);
|
spigot().sendMessage(position, components);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue