mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-06 00:07:56 +01:00
Actually set the header (#1576)
This commit is contained in:
parent
ead4f30915
commit
f7142b9603
@ -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
|
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
|
--- a/src/main/java/net/minecraft/server/IChatBaseComponent.java
|
||||||
+++ b/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
|
@@ -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) {
|
public static IChatBaseComponent a(String s) {
|
||||||
return (IChatBaseComponent)ChatDeserializer.a(a, s, IChatBaseComponent.class, false);
|
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
|
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
|
--- a/src/main/java/net/minecraft/server/PacketPlayOutTitle.java
|
||||||
+++ b/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> {
|
@@ -0,0 +0,0 @@ public class PacketPlayOutTitle implements Packet<PacketListenerPlayOut> {
|
||||||
@ -54,7 +54,7 @@ index 267b69de30..29cbe15a82 100644
|
|||||||
|
|
||||||
if (this.a == PacketPlayOutTitle.EnumTitleAction.TIMES) {
|
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
|
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
|
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||||
@@ -0,0 +0,0 @@
|
@@ -0,0 +0,0 @@
|
||||||
@ -72,15 +72,15 @@ index 2ab720d73a..9e51645c30 100644
|
|||||||
+ @Override
|
+ @Override
|
||||||
+ public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
|
+ public void setPlayerListHeaderFooter(BaseComponent[] header, BaseComponent[] footer) {
|
||||||
+ if (header != null) {
|
+ 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);
|
+ playerListHeader = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(headerJson);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ playerListHeader = null;
|
+ playerListHeader = null;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ if (footer != null) {
|
+ if (footer != null) {
|
||||||
+ String headerJson = net.md_5.bungee.chat.ComponentSerializer.toString(footer);
|
+ String footerJson = net.md_5.bungee.chat.ComponentSerializer.toString(footer);
|
||||||
+ playerListFooter = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(headerJson);
|
+ playerListFooter = net.minecraft.server.ChatBaseComponent.ChatSerializer.jsonToComponent(footerJson);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ playerListFooter = null;
|
+ playerListFooter = null;
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user