Actually set the header (#1576)

This commit is contained in:
GreenMeanie 2018-10-15 01:05:02 -04:00
parent ead4f30915
commit f7142b9603

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Player Tab List and Title APIs
diff --git a/src/main/java/net/minecraft/server/IChatBaseComponent.java b/src/main/java/net/minecraft/server/IChatBaseComponent.java
index 286c1b14f6..ff14b3e093 100644
index 286c1b14..ff14b3e0 100644
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
+++ b/src/main/java/net/minecraft/server/IChatBaseComponent.java
@@ -0,0 +0,0 @@ public interface IChatBaseComponent extends Message, Iterable<IChatBaseComponent
@ -17,7 +17,7 @@ index 286c1b14f6..ff14b3e093 100644
public static IChatBaseComponent a(String s) {
return (IChatBaseComponent)ChatDeserializer.a(a, s, IChatBaseComponent.class, false);
diff --git a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
index 267b69de30..29cbe15a82 100644
index 267b69de..29cbe15a 100644
--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
+++ b/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
@ -54,7 +54,7 @@ index 267b69de30..29cbe15a82 100644
if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index 2ab720d73a..9e51645c30 100644
index 2ab720d7..9e51bac8 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@
@ -72,15 +72,15 @@ index 2ab720d73a..9e51645c30 100644
+ @Override
+ public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
+ if (header != null) {
+ String headerJson = net.md_5.bungee.chat.ComponentSerializer.toString(footer);
+ String headerJson = net.md_5.bungee.chat.ComponentSerializer.toString(header);
+ playerListHeader = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(headerJson);
+ } else {
+ playerListHeader = null;
+ }
+
+ if (footer != null) {
+ String headerJson = net.md_5.bungee.chat.ComponentSerializer.toString(footer);
+ playerListFooter = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(headerJson);
+ String footerJson = net.md_5.bungee.chat.ComponentSerializer.toString(footer);
+ playerListFooter = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(footerJson);
+ } else {
+ playerListFooter = null;
+ }