3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-17 21:40:08 +01:00
Paper/Spigot-API-Patches/0044-Add-String-based-Action-Bar-API.patch

27 Zeilen
1.1 KiB
Diff

2016-12-20 23:34:27 +01:00
From 096901560b7ced2820b8f131d8633ccfab953a57 Mon Sep 17 00:00:00 2001
2016-12-20 21:56:41 +01:00
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
2016-12-20 23:34:27 +01:00
index 083e60f..4d577a5 100644
2016-12-20 21:56:41 +01:00
--- 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
public void sendMap(MapView map);
// Paper start
+ public default void sendActionBar(String message) {
2016-12-20 22:02:05 +01:00
+ sendMessage(net.md_5.bungee.api.ChatMessageType.ACTION_BAR, net.md_5.bungee.api.chat.TextComponent.fromLegacyText(message));
2016-12-20 21:56:41 +01:00
+ }
+ public default void sendActionBar(char alternateChar, String message) {
2016-12-20 22:02:05 +01:00
+ sendMessage(net.md_5.bungee.api.ChatMessageType.ACTION_BAR, net.md_5.bungee.api.chat.TextComponent.fromLegacyText(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message)));
2016-12-20 21:56:41 +01:00
+ }
/**
* Sends the component to the player
*
--
2016-12-20 23:34:27 +01:00
2.9.3
2016-12-20 21:56:41 +01:00