2020-05-06 09:48:49 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2016-12-27 20:06:14 +00:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Tue, 27 Dec 2016 15:02:42 -0500
|
|
|
|
Subject: [PATCH] String based Action Bar API
|
|
|
|
|
|
|
|
|
2021-03-16 07:19:45 +00:00
|
|
|
diff --git a/src/main/java/net/minecraft/SystemUtils.java b/src/main/java/net/minecraft/SystemUtils.java
|
|
|
|
index c8bb06a31242089ad950713bd5f94abbfe12adc8..68ce7605bd63ea280b96db8230463d2afb0a6cb1 100644
|
|
|
|
--- a/src/main/java/net/minecraft/SystemUtils.java
|
|
|
|
+++ b/src/main/java/net/minecraft/SystemUtils.java
|
|
|
|
@@ -58,7 +58,7 @@ public class SystemUtils {
|
2020-06-26 12:04:38 +00: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 20:06:14 +00:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-03-16 07:19:45 +00:00
|
|
|
index 6d7f1dee9ae2fb0b9620d85969de86eee09020cc..c3058d6fca2fd58aea5001e4310592aa8bd20640 100644
|
2016-12-27 20:06:14 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
2021-02-24 09:32:17 +00:00
|
|
|
@@ -244,6 +244,24 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
2018-03-10 13:07:40 +00:00
|
|
|
}
|
2016-12-27 20:06:14 +00:00
|
|
|
|
|
|
|
// Paper start
|
2018-03-10 13:07:40 +00:00
|
|
|
+ @Override
|
2020-07-22 08:01:35 +00: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 20:06:14 +00:00
|
|
|
+ public void sendActionBar(String message) {
|
|
|
|
+ if (getHandle().playerConnection == null || message == null || message.isEmpty()) return;
|
2020-07-22 08:01:35 +00:00
|
|
|
+ getHandle().playerConnection.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.ACTIONBAR, CraftChatMessage.fromStringOrNull(message)));
|
2016-12-27 20:06:14 +00: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 13:07:40 +00:00
|
|
|
@Override
|
2016-12-27 20:06:14 +00:00
|
|
|
public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
|
2018-09-01 10:09:13 +00:00
|
|
|
if (header != null) {
|