diff --git a/Common/src/main/java/customskinloader/CustomSkinLoader.java b/Common/src/main/java/customskinloader/CustomSkinLoader.java index b2a1d45..bd3750d 100644 --- a/Common/src/main/java/customskinloader/CustomSkinLoader.java +++ b/Common/src/main/java/customskinloader/CustomSkinLoader.java @@ -76,14 +76,14 @@ public static Object loadProfileLazily(GameProfile gameProfile, Function= 801 && this.protocol_version <= 803) || (this.protocol_version >= 0x40000001 && this.protocol_version <= 0x4000008E)); // 18w43b ~ 1.20.1 } else if (mixinClassName.endsWith(".MixinSkinManager$V2") || mixinClassName.endsWith(".MixinSkinManager$1") || mixinClassName.endsWith(".MixinSkinManager$CacheKey") || mixinClassName.endsWith(".MixinSkinManager$TextureCache")) { - result = this.world_version >= 3567 && ((this.protocol_version > 763 && this.protocol_version < 801) || (this.protocol_version > 803 && this.protocol_version < 0x40000001) || this.protocol_version >= 0x40000090); // 23w31a+ + result = this.world_version >= 3567 && ((this.protocol_version >= 764 && this.protocol_version < 801) || (this.protocol_version > 803 && this.protocol_version < 0x40000001) || this.protocol_version >= 0x40000090); // 23w31a+ + } else if (mixinClassName.endsWith(".MixinSkinManager$V3")) { + result = this.world_version >= 3684 && ((this.protocol_version >= 765 && this.protocol_version < 801) || (this.protocol_version > 803 && this.protocol_version < 0x40000001) || this.protocol_version >= 0x4000009D); // 23w42a+ } else if (mixinClassName.endsWith(".MixinThreadDownloadImageData$V1")) { result = (this.world_version >= 2205 && this.world_version <= 2722) && ((this.protocol_version >= 554 && this.protocol_version <= 754) || (this.protocol_version >= 801 && this.protocol_version <= 803) || (this.protocol_version >= 0x40000001 && this.protocol_version <= 0x40000022)); // 19w38a ~ 1.17-rc1 } else if (mixinClassName.endsWith(".MixinThreadDownloadImageData$V2")) { diff --git a/Fabric/src/main/java/customskinloader/mixin/MixinSkinManager.java b/Fabric/src/main/java/customskinloader/mixin/MixinSkinManager.java index cdcf91c..ab9f505 100644 --- a/Fabric/src/main/java/customskinloader/mixin/MixinSkinManager.java +++ b/Fabric/src/main/java/customskinloader/mixin/MixinSkinManager.java @@ -13,6 +13,7 @@ import com.mojang.authlib.GameProfile; import com.mojang.authlib.minecraft.MinecraftProfileTexture; import com.mojang.authlib.minecraft.MinecraftSessionService; +import com.mojang.authlib.properties.Property; import customskinloader.fake.FakeSkinManager; import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.resources.SkinManager; @@ -229,4 +230,19 @@ private Object redirect_getOrLoad(LoadingCache loadingCache, Object cacheK return FakeSkinManager.loadCache(loadingCache, cacheKey, profile); } } + + // 23w42a+ + @Mixin(SkinManager.class) + public abstract static class V3 { + @ModifyArg( + method = "Lnet/minecraft/client/resources/SkinManager;getOrLoad(Lcom/mojang/authlib/GameProfile;)Ljava/util/concurrent/CompletableFuture;", + at = @At( + value = "INVOKE", + target = "Lnet/minecraft/client/resources/SkinManager$CacheKey;(Ljava/util/UUID;Lcom/mojang/authlib/properties/Property;)V" + ) + ) + private Property modifyArg_getOrLoad(Property property) { + return FakeSkinManager.createProperty(property); + } + } } diff --git a/Fabric/src/main/resources/mixins.customskinloader.json b/Fabric/src/main/resources/mixins.customskinloader.json index ddd1c15..2121c44 100644 --- a/Fabric/src/main/resources/mixins.customskinloader.json +++ b/Fabric/src/main/resources/mixins.customskinloader.json @@ -15,6 +15,7 @@ "MixinSkinManager$TextureCache", "MixinSkinManager$V1", "MixinSkinManager$V2", + "MixinSkinManager$V3", "MixinThreadDownloadImageData$V1", "MixinThreadDownloadImageData$V2" ], diff --git a/Forge/Active/src/main/resources/transformers.js b/Forge/Active/src/main/resources/transformers.js index 5ee5e40..7291eae 100644 --- a/Forge/Active/src/main/resources/transformers.js +++ b/Forge/Active/src/main/resources/transformers.js @@ -125,7 +125,9 @@ function initializeCoreMod() { } else if (checkName(mn.name, "m_293351_") && mn.desc.equals("(Lcom/mojang/authlib/GameProfile;)Ljava/util/concurrent/CompletableFuture;")) { // 1.20.2+ for (var iterator = mn.instructions.iterator(); iterator.hasNext();) { var node = iterator.next(); - if (node.getOpcode() === Opcodes.INVOKEINTERFACE && node.owner.equals("com/google/common/cache/LoadingCache") && checkName(node.name, "getUnchecked") && node.desc.equals("(Ljava/lang/Object;)Ljava/lang/Object;")) { + if (node.getOpcode() === Opcodes.INVOKESPECIAL && node.owner.equals("net/minecraft/client/resources/SkinManager$CacheKey") && checkName(node.name, "") && node.desc.equals("(Ljava/util/UUID;Lcom/mojang/authlib/properties/Property;)V")) { + mn.instructions.insertBefore(node, new MethodInsnNode(Opcodes.INVOKESTATIC, "customskinloader/fake/FakeSkinManager", "createProperty", "(Lcom/mojang/authlib/properties/Property;)Lcom/mojang/authlib/properties/Property;", false)) + } else if (node.getOpcode() === Opcodes.INVOKEINTERFACE && node.owner.equals("com/google/common/cache/LoadingCache") && checkName(node.name, "getUnchecked") && node.desc.equals("(Ljava/lang/Object;)Ljava/lang/Object;")) { mn.instructions.insertBefore(node, new VarInsnNode(Opcodes.ALOAD, 1)); mn.instructions.set(node, new MethodInsnNode(Opcodes.INVOKESTATIC, "customskinloader/fake/FakeSkinManager", "loadCache", "(Lcom/google/common/cache/LoadingCache;Ljava/lang/Object;Lcom/mojang/authlib/GameProfile;)Ljava/lang/Object;", false)); }