From 76e7151488154df6d082567549fdc2ab047ae779 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 6 Feb 2021 16:20:03 +1300 Subject: [PATCH] Fix player disguise no name visible not loading properly --- .../me/libraryaddict/disguise/disguisetypes/Disguise.java | 4 ++-- .../libraryaddict/disguise/disguisetypes/PlayerDisguise.java | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java index ac8b00d0..195eb30a 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/Disguise.java @@ -368,8 +368,8 @@ public abstract class Disguise { if (isDynamicName()) { String name = getEntity().getCustomName(); - if (name == null) { - name = ""; + if (name == null || name.isEmpty()) { + name = isPlayerDisguise() ? "LD_NoName" : ""; } if (isPlayerDisguise()) { diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java index 43f661ba..7cce1d29 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/PlayerDisguise.java @@ -307,6 +307,10 @@ public class PlayerDisguise extends TargetedDisguise { name = DisguiseUtilities.getDisplayName(name); } + if (name.equals("")) { + name = "LD_NoName"; + } + if (name.equals(playerName)) { return; }