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()) {
|
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) {
|
if (name == null) {
|
||||||
name = "";
|
name = "";
|
||||||
@ -1014,8 +1020,14 @@ public abstract class Disguise {
|
|||||||
setExpires(DisguiseConfig.isDynamicExpiry() ? 240 * 20 : System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(330));
|
setExpires(DisguiseConfig.isDynamicExpiry() ? 240 * 20 : System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(330));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isDynamicName() && !isPlayerDisguise()) {
|
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) {
|
if (name == null) {
|
||||||
name = "";
|
name = "";
|
||||||
|
@ -648,7 +648,13 @@ public class PlayerDisguise extends TargetedDisguise {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isDynamicName()) {
|
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) {
|
if (name == null) {
|
||||||
name = "";
|
name = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user