Actually set the ChatPosition

This commit is contained in:
Aikar 2016-12-20 16:02:05 -05:00
parent 29369fb085
commit f4ea1998ee

View file

@ -1,11 +1,11 @@
From 83de0f53b126c9e390f06f8ceaa82ac4f7795c90 Mon Sep 17 00:00:00 2001
From 7b2810ce185f4805e505de6701cafb5ef86a5687 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 bf4c31ba..a4e64535 100644
index bf4c31ba..5c38b3f3 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -392,6 +392,12 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -13,10 +13,10 @@ index bf4c31ba..a4e64535 100644
// Paper start
+ public default void sendActionBar(String message) {
+ sendMessage(net.md_5.bungee.api.chat.TextComponent.fromLegacyText(message));
+ sendMessage(net.md_5.bungee.api.ChatMessageType.ACTION_BAR, net.md_5.bungee.api.chat.TextComponent.fromLegacyText(message));
+ }
+ public default void sendActionBar(char alternateChar, String message) {
+ sendMessage(net.md_5.bungee.api.chat.TextComponent.fromLegacyText(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message)));
+ sendMessage(net.md_5.bungee.api.ChatMessageType.ACTION_BAR, net.md_5.bungee.api.chat.TextComponent.fromLegacyText(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message)));
+ }
/**
* Sends the component to the player