diff --git a/Common/src/main/java/customskinloader/fake/itf/FakeInterfaceManager.java b/Common/src/main/java/customskinloader/fake/itf/FakeInterfaceManager.java index 7801532..e09b194 100644 --- a/Common/src/main/java/customskinloader/fake/itf/FakeInterfaceManager.java +++ b/Common/src/main/java/customskinloader/fake/itf/FakeInterfaceManager.java @@ -1,6 +1,5 @@ package customskinloader.fake.itf; -import java.io.IOException; import java.io.InputStream; import java.util.Optional; diff --git a/Common/src/main/java/customskinloader/loader/MojangAPILoader.java b/Common/src/main/java/customskinloader/loader/MojangAPILoader.java index d56b822..85bca69 100644 --- a/Common/src/main/java/customskinloader/loader/MojangAPILoader.java +++ b/Common/src/main/java/customskinloader/loader/MojangAPILoader.java @@ -182,10 +182,14 @@ public static Map getText String json = new String(Base64.decodeBase64(value), StandardCharsets.UTF_8); MinecraftTexturesPayload result = GSON.fromJson(json, MinecraftTexturesPayload.class); - if (result == null || TextureUtil.AuthlibField.MINECRAFT_TEXTURES_PAYLOAD_TEXTURES.get(result) == null) { + if (result == null) { return Maps.newHashMap(); } - return TextureUtil.AuthlibField.MINECRAFT_TEXTURES_PAYLOAD_TEXTURES.get(result); + Map textures = TextureUtil.AuthlibField.MINECRAFT_TEXTURES_PAYLOAD_TEXTURES.get(result); + if (textures == null) { + return Maps.newHashMap(); + } + return textures; } @Override diff --git a/Common/src/main/java/customskinloader/profile/DynamicSkullManager.java b/Common/src/main/java/customskinloader/profile/DynamicSkullManager.java index ce689fe..5583479 100644 --- a/Common/src/main/java/customskinloader/profile/DynamicSkullManager.java +++ b/Common/src/main/java/customskinloader/profile/DynamicSkullManager.java @@ -123,7 +123,8 @@ public Map parseTextures( MinecraftProfileTexture skin = textures.get(MinecraftProfileTexture.Type.SKIN); String skinUrl = skin.getUrl(); if (!HttpUtil0.isLocal(skinUrl)) - return textures; + // Wrap MinecraftProfileTexture to FakeMinecraftProfileTexture + return ModelManager0.fromUserProfile(ModelManager0.toUserProfile(textures)); File skinFile = new File(CustomSkinLoader.DATA_DIR, skinUrl); if (!skinFile.isFile()) return Maps.newHashMap(); diff --git a/Dummy/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java b/Dummy/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java index bf43aed..9cdf5dd 100644 --- a/Dummy/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java +++ b/Dummy/src/main/java/net/minecraft/client/renderer/texture/TextureManager.java @@ -4,6 +4,7 @@ public class TextureManager { public ITextureObject getTexture(ResourceLocation location) { return null; } - public boolean loadTexture(ResourceLocation location, ITextureObject object) { return false; } + public void loadTexture(ResourceLocation location, AbstractTexture texture) {} + public boolean loadTexture(ResourceLocation location, ITextureObject texture) { return false; } public void registerAndLoad(ResourceLocation resourceLocation, ReloadableTexture reloadableTexture) {} } diff --git a/Fabric/Fabric.tsrg b/Fabric/Fabric.tsrg index 87a904a..650ec69 100644 --- a/Fabric/Fabric.tsrg +++ b/Fabric/Fabric.tsrg @@ -52,6 +52,7 @@ net/minecraft/client/renderer/texture/SimpleTexture net/minecraft/class_1049 net/minecraft/client/renderer/texture/TextureContents net/minecraft/class_10539 net/minecraft/client/renderer/texture/TextureManager net/minecraft/class_1060 getTexture (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; method_4619 + loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/AbstractTexture;)V method_4616 loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z method_4616 registerAndLoad (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ReloadableTexture;)V method_65876 net/minecraft/client/resources/DefaultPlayerSkin net/minecraft/class_1068 diff --git a/Forge/V2/Forge.tsrg b/Forge/V2/Forge.tsrg index da19af1..7f71e69 100644 --- a/Forge/V2/Forge.tsrg +++ b/Forge/V2/Forge.tsrg @@ -52,6 +52,7 @@ net/minecraft/client/renderer/texture/SimpleTexture net/minecraft/client/rendere net/minecraft/client/renderer/texture/TextureContents net/minecraft/client/renderer/texture/TextureContents net/minecraft/client/renderer/texture/TextureManager net/minecraft/client/renderer/texture/TextureManager getTexture (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; func_110581_b + loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/AbstractTexture;)V m_118495_ loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z func_110579_a registerAndLoad (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ReloadableTexture;)V registerAndLoad net/minecraft/client/resources/DefaultPlayerSkin net/minecraft/client/resources/DefaultPlayerSkin diff --git a/Forge/V3/Forge.tsrg b/Forge/V3/Forge.tsrg index f798713..4ba176a 100644 --- a/Forge/V3/Forge.tsrg +++ b/Forge/V3/Forge.tsrg @@ -52,6 +52,7 @@ net/minecraft/client/renderer/texture/SimpleTexture net/minecraft/client/rendere net/minecraft/client/renderer/texture/TextureContents net/minecraft/client/renderer/texture/TextureContents net/minecraft/client/renderer/texture/TextureManager net/minecraft/client/renderer/texture/TextureManager getTexture (Lnet/minecraft/util/ResourceLocation;)Lnet/minecraft/client/renderer/texture/ITextureObject; getTexture + loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/AbstractTexture;)V register loadTexture (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ITextureObject;)Z register registerAndLoad (Lnet/minecraft/util/ResourceLocation;Lnet/minecraft/client/renderer/texture/ReloadableTexture;)V registerAndLoad net/minecraft/client/resources/DefaultPlayerSkin net/minecraft/client/resources/DefaultPlayerSkin diff --git a/Vanilla/Common/src/main/java/customskinloader/mixin/MixinSkinTextureDownloader.java b/Vanilla/Common/src/main/java/customskinloader/mixin/MixinSkinTextureDownloader.java index 1071332..8214199 100644 --- a/Vanilla/Common/src/main/java/customskinloader/mixin/MixinSkinTextureDownloader.java +++ b/Vanilla/Common/src/main/java/customskinloader/mixin/MixinSkinTextureDownloader.java @@ -21,6 +21,11 @@ public abstract class MixinSkinTextureDownloader { ) ) private static void redirect_lambda$registerTextureInManager$2(TextureManager manager, ResourceLocation location, AbstractTexture texture) { - manager.registerAndLoad(location, (ReloadableTexture) FakeInterfaceManager.ResourceLocation_getTexture(location)); + Object texture0 = FakeInterfaceManager.ResourceLocation_getTexture(location); + if (texture0 != null) { + manager.registerAndLoad(location, (ReloadableTexture) texture0); + } else { + manager.loadTexture(location, texture); + } } }