map = Maps.newHashMap();
- map.putAll(m);
+ /**
+ * Invoked from {@link SkinManager#loadSkin(MinecraftProfileTexture, MinecraftProfileTexture.Type, SkinAvailableCallback)}
+ *
+ * {@code skinAvailableCallback.skinAvailable(textureType, resourcelocation, profileTexture);} -> {@code skinAvailableCallback.skinAvailable(textureType, resourcelocation, this.fakeManager.getModelCache(profileTexture, resourcelocation));}
+ *
+ */
+ public static MinecraftProfileTexture getModelCache(MinecraftProfileTexture profileTexture, FakeSkinManager fakeManager, ResourceLocation location) {
+ return fakeManager.modelCache.getOrDefault(location, profileTexture);
+ }
- for (MinecraftProfileTexture.Type type : MinecraftProfileTexture.Type.values()) {
- MinecraftProfileTexture profileTexture = map.get(type);
- if (profileTexture != null) {
- HttpTextureUtil.HttpTextureInfo info = HttpTextureUtil.toHttpTextureInfo(profileTexture.getUrl());
- FakeThreadDownloadImageData.downloadTexture(info.cacheFile, info.url);
-
- FakeInterfaceManager.Minecraft_addScheduledTask(Minecraft.getMinecraft(), () -> {
- CustomSkinLoader.logger.debug("Loading type: " + type);
- try {
- this.loadSkin(profileTexture, info, type, skinAvailableCallback);
- } catch (Throwable t) {
- CustomSkinLoader.logger.warning(t);
- }
- });
+ /**
+ * Invoked from {@link SkinManager#loadSkin(MinecraftProfileTexture, MinecraftProfileTexture.Type, SkinAvailableCallback)}
+ */
+ public static Object[] createThreadDownloadImageData(ImmutableList