From 5b5989b213ad947374b0e74f313029eb66ba9365 Mon Sep 17 00:00:00 2001 From: MiniDigger Date: Wed, 3 Mar 2021 20:08:25 +0100 Subject: [PATCH] fix nullability of playerlist header/footer, closes #5290 --- Spigot-Server-Patches/0010-Adventure.patch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/0010-Adventure.patch b/Spigot-Server-Patches/0010-Adventure.patch index fd5d0af1d..08f70113f 100644 --- a/Spigot-Server-Patches/0010-Adventure.patch +++ b/Spigot-Server-Patches/0010-Adventure.patch @@ -1978,7 +1978,7 @@ index 96b55867d8bfbc85cb290da9b320ec74b9dbb179..513d24877c336b6e32f2ef939788d108 player.activeContainer.addSlotListener(player); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 1cbf0fd6c0f2d1fa62f944162cd9320c640d8530..5f55e3816f1e00be6e4ae573cc09eb19b59adf74 100644 +index 1cbf0fd6c0f2d1fa62f944162cd9320c640d8530..32a8a074600519ec2075229bbd02ca1e4123a70f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -240,14 +240,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -2045,14 +2045,14 @@ index 1cbf0fd6c0f2d1fa62f944162cd9320c640d8530..5f55e3816f1e00be6e4ae573cc09eb19 @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 1cbf0fd6c0f2d1fa62f944162cd9320c640d8530..5f55e3816f1e00be6e4ae573cc09eb19 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(); }