mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-06 02:42:14 +01:00
Don't ignore newlines in PlayerListHeader/Footer
This commit is contained in:
parent
77ca7ca07b
commit
39a287b7da
@ -243,20 +243,20 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlayerListHeader(String header) {
|
public void setPlayerListHeader(String header) {
|
||||||
this.playerListHeader = CraftChatMessage.fromStringOrNull(header);
|
this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true);
|
||||||
updatePlayerListHeaderFooter();
|
updatePlayerListHeaderFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlayerListFooter(String footer) {
|
public void setPlayerListFooter(String footer) {
|
||||||
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer);
|
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true);
|
||||||
updatePlayerListHeaderFooter();
|
updatePlayerListHeaderFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlayerListHeaderFooter(String header, String footer) {
|
public void setPlayerListHeaderFooter(String header, String footer) {
|
||||||
this.playerListHeader = CraftChatMessage.fromStringOrNull(header);
|
this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true);
|
||||||
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer);
|
this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true);
|
||||||
updatePlayerListHeaderFooter();
|
updatePlayerListHeaderFooter();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +143,11 @@ public final class CraftChatMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static IChatBaseComponent fromStringOrNull(String message) {
|
public static IChatBaseComponent fromStringOrNull(String message) {
|
||||||
return (message == null || message.isEmpty()) ? null : fromString(message)[0];
|
return fromStringOrNull(message, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IChatBaseComponent fromStringOrNull(String message, boolean keepNewlines) {
|
||||||
|
return (message == null || message.isEmpty()) ? null : fromString(message, keepNewlines)[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IChatBaseComponent[] fromString(String message) {
|
public static IChatBaseComponent[] fromString(String message) {
|
||||||
|
Loading…
Reference in New Issue
Block a user