mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
String based Action Bar API
This commit is contained in:
parent
e27e53d201
commit
1c531f852f
@ -395,6 +395,28 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
}
|
||||
|
||||
// Paper start
|
||||
@Override
|
||||
@Deprecated
|
||||
public void sendActionBar(BaseComponent[] message) {
|
||||
if (getHandle().connection == null) return;
|
||||
net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket packet = new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(org.bukkit.craftbukkit.util.CraftChatMessage.fromJSON(net.md_5.bungee.chat.ComponentSerializer.toString(message)));
|
||||
getHandle().connection.send(packet);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void sendActionBar(String message) {
|
||||
if (getHandle().connection == null || message == null || message.isEmpty()) return;
|
||||
getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundSetActionBarTextPacket(CraftChatMessage.fromStringOrNull(message)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public void sendActionBar(char alternateChar, String message) {
|
||||
if (message == null || message.isEmpty()) return;
|
||||
sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
|
||||
if (header != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user