This commit is contained in:
ZekerZhayard authored and GitHub committed 2023-12-18 21:04:28 +08:00
1 parent d2772697f3
commit 7fd5ff84ee
6 files changed
+32 -4

No files matched your search

@@ -76,14 +76,14 @@ public class CustomSkinLoader {
// Fix: http://hopper.minecraft.net/crashes/minecraft/MCX-2773713
if (username == null) {
logger.warning("Could not load profile: username is null.");
return function.apply(null);
return function.apply(new UserProfile());
}
String tempName = Thread.currentThread().getName();
Thread.currentThread().setName(username); // Change Thread Name
if (profileCache.isLoading(credential)) {
profileCache.putLoader(credential, function);
Thread.currentThread().setName(tempName);
return function.apply(null);
return function.apply(new UserProfile());
}
Object result = function.apply(loadProfile(gameProfile));
Thread.currentThread().setName(tempName);
@@ -50,6 +50,13 @@ public class FakeSkinManager {
return cacheLoader = loader;
}
/**
* Invoked from {@link SkinManager#getOrLoad(GameProfile)}
*/
public static Property createProperty(Property property) {
return property == null ? new Property(null, null) : new Property(TextureUtil.AuthlibField.PROPERTY_NAME.get(property), TextureUtil.AuthlibField.PROPERTY_VALUE.get(property), TextureUtil.AuthlibField.PROPERTY_SIGNATURE.get(property));
}
/**
* Invoked from {@link SkinManager#getOrLoad(GameProfile)}
*/