Empty names will now hide the name on PlayerDisguise
This commit is contained in:
parent
203f2adeb5
commit
d0bb5021bf
@ -50,12 +50,7 @@ public class PlayerDisguise extends TargetedDisguise {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public PlayerDisguise(String name) {
|
public PlayerDisguise(String name) {
|
||||||
this();
|
this(name, name);
|
||||||
|
|
||||||
setName(name);
|
|
||||||
setSkin(name);
|
|
||||||
|
|
||||||
createDisguise();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public PlayerDisguise(String name, String skinToUse) {
|
public PlayerDisguise(String name, String skinToUse) {
|
||||||
@ -201,6 +196,12 @@ public class PlayerDisguise extends TargetedDisguise {
|
|||||||
|
|
||||||
if (isDisguiseInUse() && isNameVisible()) {
|
if (isDisguiseInUse() && isNameVisible()) {
|
||||||
if (stopDisguise()) {
|
if (stopDisguise()) {
|
||||||
|
if (getName().isEmpty() && !name.isEmpty()) {
|
||||||
|
setNameVisible(true);
|
||||||
|
} else if (name.isEmpty()) {
|
||||||
|
setNameVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
playerName = name;
|
playerName = name;
|
||||||
|
|
||||||
if (gameProfile != null) {
|
if (gameProfile != null) {
|
||||||
@ -215,6 +216,12 @@ public class PlayerDisguise extends TargetedDisguise {
|
|||||||
throw new IllegalStateException("Unable to restart disguise");
|
throw new IllegalStateException("Unable to restart disguise");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (getName() != null&&!getName().isEmpty() && name.isEmpty()) {
|
||||||
|
setNameVisible(false);
|
||||||
|
} else if (!name.isEmpty()) {
|
||||||
|
setNameVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
playerName = name;
|
playerName = name;
|
||||||
|
|
||||||
if (gameProfile != null) {
|
if (gameProfile != null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user