From 6ae2121257b554cd349a32bebb928780f02ab57d Mon Sep 17 00:00:00 2001 From: Riley Park Date: Tue, 23 Feb 2021 16:48:02 -0800 Subject: [PATCH] Display name should never be null --- Spigot-Server-Patches/0010-Adventure.patch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Spigot-Server-Patches/0010-Adventure.patch b/Spigot-Server-Patches/0010-Adventure.patch index e2cf2cb85..2a4904089 100644 --- a/Spigot-Server-Patches/0010-Adventure.patch +++ b/Spigot-Server-Patches/0010-Adventure.patch @@ -1829,7 +1829,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 8428ef53e0408c4a7f74cc03e7e238be9c2f1888..fcc6a3d3b68b6a63ee08b9d66c77f4d63ae27551 100644 +index 8428ef53e0408c4a7f74cc03e7e238be9c2f1888..aac172afc8343f325612fdc608630560fb52ca19 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -239,14 +239,39 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -1842,7 +1842,7 @@ index 8428ef53e0408c4a7f74cc03e7e238be9c2f1888..fcc6a3d3b68b6a63ee08b9d66c77f4d6 @Override public void setDisplayName(final String name) { -+ this.getHandle().adventure$displayName = name != null ? io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(name) : null; if (true) return; // Paper ++ this.getHandle().adventure$displayName = name != null ? io.papermc.paper.adventure.PaperAdventure.LEGACY_SECTION_UXRC.deserialize(name) : net.kyori.adventure.text.Component.text(this.getName()); if (true) return; // Paper getHandle().displayName = name == null ? getName() : name; } @@ -2026,7 +2026,7 @@ index 8428ef53e0408c4a7f74cc03e7e238be9c2f1888..fcc6a3d3b68b6a63ee08b9d66c77f4d6 + + @Override + public void displayName(final net.kyori.adventure.text.Component displayName) { -+ this.getHandle().adventure$displayName = displayName; ++ this.getHandle().adventure$displayName = displayName != null ? displayName : net.kyori.adventure.text.Component.text(this.getName()); + } + + @Override