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
|
|
|
|
|
|
|
|
|
2020-06-26 14:04:38 +02:00
|
|
|
diff --git a/src/main/java/net/minecraft/server/SystemUtils.java b/src/main/java/net/minecraft/server/SystemUtils.java
|
2020-08-25 04:22:08 +02:00
|
|
|
index bdfd17362518ff2398cf9e1743a7a4f0c7a0e966..cc14e4b4609fa7013df666181c0e02a53970c123 100644
|
2020-06-26 14:04:38 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/SystemUtils.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/SystemUtils.java
|
2020-08-25 04:22:08 +02:00
|
|
|
@@ -52,7 +52,7 @@ public class SystemUtils {
|
2020-06-26 14:04:38 +02:00
|
|
|
private static final ExecutorService e = a("Main");
|
|
|
|
private static final ExecutorService f = n();
|
|
|
|
public static LongSupplier a = System::nanoTime;
|
|
|
|
- public static final UUID b = new UUID(0L, 0L);
|
|
|
|
+ public static final UUID b = new UUID(0L, 0L); public static final UUID getNullUUID() {return b;} // Paper OBFHELPER
|
|
|
|
private static final Logger LOGGER = LogManager.getLogger();
|
|
|
|
|
|
|
|
public static <K, V> Collector<Entry<? extends K, ? extends V>, ?, Map<K, V>> a() {
|
2016-12-27 21:06:14 +01:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-02-21 20:45:33 +01:00
|
|
|
index b5f296b23f5ed30f855fec79775d0026ff2f1d6e..82c99fbab334e16c39ac23ca3765f9543e8d147a 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
|
2021-02-05 23:52:27 +01:00
|
|
|
@@ -243,6 +243,24 @@ 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
|
2020-07-22 10:01:35 +02:00
|
|
|
+ public void sendActionBar(BaseComponent[] message) {
|
|
|
|
+ if (getHandle().playerConnection == null) return;
|
|
|
|
+ getHandle().playerConnection.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, message, -1, -1, -1));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
2016-12-27 21:06:14 +01:00
|
|
|
+ public void sendActionBar(String message) {
|
|
|
|
+ if (getHandle().playerConnection == null || message == null || message.isEmpty()) return;
|
2020-07-22 10:01:35 +02:00
|
|
|
+ getHandle().playerConnection.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, CraftChatMessage.fromStringOrNull(message)));
|
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) {
|