Switch to regex match

There is exactly one overload we want, and it has a callback in its parameter.
This commit is contained in:
Phoenix-Starlight 2023-10-23 20:04:45 -07:00
parent c980677c75
commit cb69332072

View File

@ -30,12 +30,16 @@ public abstract class SkinManagerMixin {
@WrapOperation @WrapOperation
( (
method = "registerTexture{1}(*Lnet/minecraft/client/resources/SkinManager$SkinTextureCallback;)Lnet/minecraft/util/Identifier", method =
"name = registerTexture " +
// Target the lone overload that has a SkinTextureAvailableCallBack
"desc = /\\(net\\/minecraft\\/class_1071\\$class_1072;\\)/",
at = @At( at = @At(
value = "INVOKE", value = "INVOKE",
target = "Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;getHash()Ljava/lang/String;", target = "Lcom/mojang/authlib/minecraft/MinecraftProfileTexture;getHash()Ljava/lang/String;",
remap = false remap = false
) ),
allow = 1
) )
private String stashCachedHash(MinecraftProfileTexture texture, Operation<String> original) { private String stashCachedHash(MinecraftProfileTexture texture, Operation<String> original) {
return hashCache.computeIfAbsent(texture, k -> original.call()); return hashCache.computeIfAbsent(texture, k -> original.call());