mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-09 06:50:32 +08:00
Actually set the header (#1576)
This commit is contained in:
parent
c4c9984906
commit
03ecc80de8
@ -1,11 +1,11 @@
|
||||
From 636e742ec2316e633fb571f41ef8e6e4a6fdb4c1 Mon Sep 17 00:00:00 2001
|
||||
From 25b13058491216858b504fb43d55fcd62df61a84 Mon Sep 17 00:00:00 2001
|
||||
From: Techcable <Techcable@outlook.com>
|
||||
Date: Thu, 3 Mar 2016 02:32:10 -0600
|
||||
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
|
||||
@@ -354,6 +354,7 @@ 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
|
||||
@@ -12,6 +12,17 @@ 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
|
||||
@@ -1,5 +1,6 @@
|
||||
@ -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;
|
||||
+ }
|
||||
|
Loading…
Reference in New Issue
Block a user