Display name should never be null

This commit is contained in:
Riley Park 2021-02-23 16:48:02 -08:00
parent 2233321504
commit 46be0dcaf3

View File

@ -1842,7 +1842,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
@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 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @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