mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-22 18:59:46 +00:00
Support 1.19.1. Remove Vanilla 1.19. (#218)
This commit is contained in:
1 parent
02b24229f3
commit
46b8635e10
21 files changed
+103
-73
No files matched your search
@@ -2,6 +2,7 @@ package customskinloader;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
@@ -44,6 +45,8 @@ public class CustomSkinLoader {
|
||||
private static final ProfileCache profileCache=new ProfileCache();
|
||||
private static final DynamicSkullManager dynamicSkullManager=new DynamicSkullManager();
|
||||
|
||||
private static final ExecutorService THREAD_POOL = new ThreadPoolExecutor(config.threadPoolSize, config.threadPoolSize, 1L, TimeUnit.MINUTES, new LinkedBlockingQueue<>());
|
||||
|
||||
//Correct thread name in thread pool
|
||||
private static final ThreadFactory defaultFactory = Executors.defaultThreadFactory();
|
||||
private static final ThreadFactory customFactory = r -> {
|
||||
@@ -59,6 +62,10 @@ public class CustomSkinLoader {
|
||||
new LinkedBlockingQueue<>(333), customFactory, new ThreadPoolExecutor.DiscardOldestPolicy()
|
||||
);
|
||||
|
||||
public static void loadProfileTextures(Runnable runnable) {
|
||||
THREAD_POOL.execute(runnable);
|
||||
}
|
||||
|
||||
public static void loadProfileLazily(GameProfile gameProfile, Consumer<Map<MinecraftProfileTexture.Type, MinecraftProfileTexture>> consumer) {
|
||||
String username = gameProfile.getName();
|
||||
String credential = MinecraftUtil.getCredential(gameProfile);
|
||||
|
||||
Reference in new issue
Block a user