2020-05-06 11:48:49 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-12-27 21:06:14 +01:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 27 Dec 2016 15:02:42 -0500
|
|
|
|
Subject: [PATCH] String based Action Bar API
|
|
|
|
|
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2020-06-25 14:04:34 +02:00
|
|
|
index 20cb63419a049ce9dcaf2f0c99274501ebf9aa8c..527c116c23a505eead00e73a39ce9f932eb4ad8d 100644
|
2016-12-27 21:06:14 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2020-06-25 14:04:34 +02:00
|
|
|
@@ -219,6 +219,18 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2018-03-10 14:07:40 +01:00
|
|
|
}
|
2016-12-27 21:06:14 +01:00
|
|
|
|
|
|
|
// Paper start
|
2018-03-10 14:07:40 +01:00
|
|
|
+ @Override
|
2016-12-27 21:06:14 +01:00
|
|
|
+ public void sendActionBar(String message) {
|
|
|
|
+ if (getHandle().playerConnection == null || message == null || message.isEmpty()) return;
|
2018-07-19 06:42:43 +02:00
|
|
|
+ getHandle().playerConnection.sendPacket(new PacketPlayOutChat(new net.minecraft.server.ChatComponentText(message), net.minecraft.server.ChatMessageType.GAME_INFO));
|
2016-12-27 21:06:14 +01:00
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void sendActionBar(char alternateChar, String message) {
|
|
|
|
+ if (message == null || message.isEmpty()) return;
|
|
|
|
+ sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message));
|
|
|
|
+ }
|
|
|
|
+
|
2018-03-10 14:07:40 +01:00
|
|
|
@Override
|
2016-12-27 21:06:14 +01:00
|
|
|
public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
|
2018-09-01 12:09:13 +02:00
|
|
|
if (header != null) {
|