Fix skull loading lag for Minecraft 1.13.2 or older version. (#91)

This commit is contained in:
ZekerZhayard authored and GitHub committed 2020-05-15 22:51:04 +08:00
1 parent ad846f37a2
commit fdceb08a2c
5 files changed
+61 -26

No files matched your search

@@ -166,12 +166,15 @@ public class CustomSkinLoader {
UserProfile profile=profileCache.getProfile(credential);
return ModelManager0.fromUserProfile(profile);
}
//profileCache.setLoading(username, true);
Thread loadThread= new Thread(() -> {
loadProfile0(gameProfile);//Load in thread
});
loadThread.setName(username + "'s skull");
threadPool.execute(loadThread);
if (!profileCache.isLoading(credential)) {
profileCache.setLoading(credential, true);
threadPool.execute(() -> {
String tempName = Thread.currentThread().getName();
Thread.currentThread().setName(username + "'s skull");
loadProfile0(gameProfile);//Load in thread
Thread.currentThread().setName(tempName);
});
}
return Maps.newHashMap();
}