Let setDynamicName work on player disguises and player entities
This commit is contained in:
parent
43aa37a9ec
commit
9593225f8e
@ -380,7 +380,13 @@ public abstract class Disguise {
|
||||
}
|
||||
|
||||
if (isDynamicName()) {
|
||||
String name = getEntity().getCustomName();
|
||||
String name;
|
||||
|
||||
if (getEntity() instanceof Player) {
|
||||
name = DisguiseUtilities.translateAlternateColorCodes(DisguiseUtilities.getDisplayName(getEntity()));
|
||||
} else {
|
||||
name = getEntity().getCustomName();
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
name = "";
|
||||
@ -1014,8 +1020,14 @@ public abstract class Disguise {
|
||||
setExpires(DisguiseConfig.isDynamicExpiry() ? 240 * 20 : System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(330));
|
||||
}
|
||||
|
||||
if (isDynamicName() && !isPlayerDisguise()) {
|
||||
String name = getEntity().getCustomName();
|
||||
if (isDynamicName()) {
|
||||
String name;
|
||||
|
||||
if (getEntity() instanceof Player) {
|
||||
name = DisguiseUtilities.translateAlternateColorCodes(DisguiseUtilities.getDisplayName(getEntity()));
|
||||
} else {
|
||||
name = getEntity().getCustomName();
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
name = "";
|
||||
|
@ -648,7 +648,13 @@ public class PlayerDisguise extends TargetedDisguise {
|
||||
}
|
||||
|
||||
if (isDynamicName()) {
|
||||
String name = getEntity().getCustomName();
|
||||
String name;
|
||||
|
||||
if (getEntity() instanceof Player) {
|
||||
name = DisguiseUtilities.translateAlternateColorCodes(DisguiseUtilities.getDisplayName(getEntity()));
|
||||
} else {
|
||||
name = getEntity().getCustomName();
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
name = "";
|
||||
|
Loading…
Reference in New Issue
Block a user