Set custom name dynamically on start

This commit is contained in:
libraryaddict 2020-02-05 14:29:04 +13:00
parent 01fa2ff843
commit 852d8c9f2b
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4

View File

@ -413,7 +413,17 @@ public class PlayerDisguise extends TargetedDisguise {
} }
} }
if (getName().equals("<Inherit>") && getEntity() != null) { if (isDynamicName()) {
String name = getEntity().getCustomName();
if (name == null) {
name = "";
}
if (!getName().equals(name)) {
setName(name);
}
} else if (getName().equals("<Inherit>") && getEntity() != null) {
String name = getEntity().getCustomName(); String name = getEntity().getCustomName();
if (name == null || name.isEmpty()) { if (name == null || name.isEmpty()) {