-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spigots implementation around the header/footer strips newlines from the header/footer, this patch allows the tab list header/footer to retain newlines.
- Loading branch information
1 parent
4a32225
commit a5dc62d
Showing
2 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
Spigot-Server-Patches/0051-Player-Tab-List-and-Title-APIs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
Spigot-Server-Patches/0357-fix-newlines-in-spigot-tab-list-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
From 8e85f047aee118800f7ecdf97ac8456800cff021 Mon Sep 17 00:00:00 2001 | ||
From: Shane Freeder <theboyetronic@gmail.com> | ||
Date: Sat, 1 Sep 2018 11:29:52 +0100 | ||
Subject: [PATCH] fix newlines in spigot tab list API | ||
|
||
Spigots implementation around the header/footer strips newlines from the | ||
header/footer, this patch allows the tab list header/footer to retain newlines. | ||
|
||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | ||
index f372f19dec..b6cf96e187 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | ||
@@ -370,20 +370,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player { | ||
|
||
@Override | ||
public void setPlayerListHeader(String header) { | ||
- this.playerListHeader = CraftChatMessage.fromStringOrNull(header); | ||
+ this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API | ||
updatePlayerListHeaderFooter(); | ||
} | ||
|
||
@Override | ||
public void setPlayerListFooter(String footer) { | ||
- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer); | ||
+ this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API | ||
updatePlayerListHeaderFooter(); | ||
} | ||
|
||
@Override | ||
public void setPlayerListHeaderFooter(String header, String footer) { | ||
- this.playerListHeader = CraftChatMessage.fromStringOrNull(header); | ||
- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer); | ||
+ this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true); // Paper - fix up spigot tab API | ||
+ this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true); // Paper - fix up spigot tab API | ||
updatePlayerListHeaderFooter(); | ||
} | ||
|
||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java | ||
index a067e39d54..5e20a9a619 100644 | ||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java | ||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftChatMessage.java | ||
@@ -143,7 +143,13 @@ public final class CraftChatMessage { | ||
} | ||
|
||
public static IChatBaseComponent fromStringOrNull(String message) { | ||
- return (message == null || message.isEmpty()) ? null : fromString(message)[0]; | ||
+ // Paper start - fix up spigot tab API | ||
+ return fromStringOrNull(message, false); | ||
+ } | ||
+ | ||
+ public static IChatBaseComponent fromStringOrNull(String message, boolean keepNewlines) { | ||
+ return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0]; | ||
+ // Paper end - fix up spigot tab API | ||
} | ||
|
||
public static IChatBaseComponent[] fromString(String message) { | ||
-- | ||
2.18.0 | ||
|
a5dc62d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Now it is taking more than 40 seconds to start the server, in case I am not hallucinating?
Regards.
a5dc62d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Resoluciones that would be unrelated to this commit...