Fix error for multiname length, don't refuse old bossbars

This commit is contained in:
libraryaddict 2020-06-22 19:32:41 +12:00
parent e317f676b3
commit 3ebf9cce65
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
2 changed files with 6 additions and 4 deletions

View File

@ -77,7 +77,7 @@ public abstract class Disguise {
@Getter
private BarStyle bossBarStyle = DisguiseConfig.getBossBarStyle();
@Getter(value = AccessLevel.PRIVATE)
private final NamespacedKey bossBar = new NamespacedKey(LibsDisguises.getInstance(), UUID.randomUUID().toString());
private transient final NamespacedKey bossBar = new NamespacedKey(LibsDisguises.getInstance(), UUID.randomUUID().toString());
private FlagWatcher watcher;
/**
* If set, how long before disguise expires
@ -114,7 +114,7 @@ public abstract class Disguise {
}
public int getMultiNameLength() {
return multiName.length;
return multiName == null ? 0 : multiName.length;
}
@RandomDefaultValue

View File

@ -704,16 +704,18 @@ public class DisguiseUtilities {
}
public static WrappedGameProfile getGameProfile(String playerName) {
playerName = playerName.toLowerCase();
if (!hasGameProfile(playerName))
return null;
if (!profileCache.exists())
profileCache.mkdirs();
File file = new File(profileCache, playerName.toLowerCase());
File file = new File(profileCache, playerName);
if (!file.exists()) {
cachedNames.remove(playerName.toLowerCase());
cachedNames.remove(playerName);
return null;
}