2121import com .mojang .authlib .minecraft .MinecraftProfileTexture ;
2222import dev .terminalmc .nocapes .NoCapes ;
2323import net .minecraft .client .resources .SkinManager ;
24- import net .minecraft .resources . ResourceLocation ;
24+ import net .minecraft .core . ClientAsset ;
2525import org .spongepowered .asm .mixin .Mixin ;
2626import org .spongepowered .asm .mixin .Unique ;
2727import org .spongepowered .asm .mixin .injection .At ;
@@ -38,9 +38,9 @@ public class MixinSkinManager {
3838 ordinal = 1
3939 )
4040 )
41- private CompletableFuture <ResourceLocation > wrapLoadCape (
42- SkinManager .TextureCache instance , MinecraftProfileTexture texture ,
43- Operation <CompletableFuture <ResourceLocation >> original ) {
41+ private CompletableFuture <ClientAsset . Texture > wrapLoadCape (
42+ SkinManager .TextureCache instance , MinecraftProfileTexture texture ,
43+ Operation <CompletableFuture <ClientAsset . Texture >> original ) {
4444 return noCapes$wrapLoadTexture (instance , texture , original );
4545 }
4646
@@ -52,23 +52,23 @@ private CompletableFuture<ResourceLocation> wrapLoadCape(
5252 ordinal = 2
5353 )
5454 )
55- private CompletableFuture <ResourceLocation > wrapLoadElytra (
55+ private CompletableFuture <ClientAsset . Texture > wrapLoadElytra (
5656 SkinManager .TextureCache instance , MinecraftProfileTexture texture ,
57- Operation <CompletableFuture <ResourceLocation >> original ) {
57+ Operation <CompletableFuture <ClientAsset . Texture >> original ) {
5858 return noCapes$wrapLoadTexture (instance , texture , original );
5959 }
60-
60+
6161 @ Unique
62- private CompletableFuture <ResourceLocation > noCapes$wrapLoadTexture (
62+ private CompletableFuture <ClientAsset . Texture > noCapes$wrapLoadTexture (
6363 SkinManager .TextureCache instance , MinecraftProfileTexture texture ,
64- Operation <CompletableFuture <ResourceLocation >> original ) {
65- return original .call (instance , texture ).thenApply ((location ) -> {
64+ Operation <CompletableFuture <ClientAsset . Texture >> original ) {
65+ return original .call (instance , texture ).thenApply ((asset ) -> {
6666 String hash = texture .getHash ();
67- if (!NoCapes .RESOURCE_CAPE_CACHE .containsKey (location )) {
68- NoCapes .RESOURCE_CAPE_CACHE .put (location , hash );
67+ if (!NoCapes .RESOURCE_CAPE_CACHE .containsKey (asset . texturePath () )) {
68+ NoCapes .RESOURCE_CAPE_CACHE .put (asset . texturePath () , hash );
6969 NoCapes .checkInConfig (hash , "https://textures.minecraft.net/texture/" + hash );
7070 }
71- return location ;
71+ return asset ;
7272 });
7373 }
7474}
0 commit comments