fix nullability of playerlist header/footer, closes #5290

This commit is contained in:
MiniDigger | Martin 2021-03-03 20:08:25 +01:00
parent b0df4d17c8
commit de5a2a4108

View file

@ -2045,14 +2045,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@Override
public void setPlayerListHeader(String header) {
- this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true);
+ this.playerListHeader = io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(header); // Paper - Adventure
+ this.playerListHeader = header == null ? null : io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(header); // Paper - Adventure
updatePlayerListHeaderFooter();
}
@Override
public void setPlayerListFooter(String footer) {
- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true);
+ this.playerListFooter = io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(footer); // Paper - Adventure
+ this.playerListFooter = footer == null ? null : io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(footer); // Paper - Adventure
updatePlayerListHeaderFooter();
}
@ -2060,8 +2060,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public void setPlayerListHeaderFooter(String header, String footer) {
- this.playerListHeader = CraftChatMessage.fromStringOrNull(header, true);
- this.playerListFooter = CraftChatMessage.fromStringOrNull(footer, true);
+ this.playerListHeader = io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(header); // Paper - Adventure
+ this.playerListFooter = io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(footer); // Paper - Adventure
+ this.playerListHeader = header == null ? null : io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(header); // Paper - Adventure
+ this.playerListFooter = footer == null ? null : io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(footer); // Paper - Adventure
updatePlayerListHeaderFooter();
}