Fixup jsonwebtoken compat injections

Closes https://github.com/ViaVersion/ViaFabricPlus/issues/437
This commit is contained in:
FlorianMichael 2024-06-11 22:28:08 +02:00
parent 8c34100ee1
commit aa27837c56
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
/*
* JsonWebToken is used by MinecraftAuth and since it's using Java services, it's not working with the fabric loader
* JsonWebToken is used by MinecraftAuth, and since it's using Java services, it's not working with the fabric loader,
* So we have to change all services usages by using the normal Java API
*/
@Mixin(value = Classes.class, remap = false)

View File

@ -26,13 +26,13 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
/*
* JsonWebToken is used by MinecraftAuth and since it's using Java services, it's not working with the fabric loader
* JsonWebToken is used by MinecraftAuth, and since it's using Java services, it's not working with the fabric loader,
* So we have to change all services usages by using the normal Java API
*/
@Mixin(value = DefaultJwtParserBuilder.class, remap = false)
public abstract class MixinDefaultJwtParserBuilder {
@Redirect(method = "build()Lio/jsonwebtoken/JwtParser;", at = @At(value = "INVOKE", target = "Lio/jsonwebtoken/impl/lang/Services;get(Ljava/lang/Class;)Ljava/lang/Object;"))
@Redirect(method = "build()Lio/jsonwebtoken/JwtParser;", at = @At(value = "INVOKE", target = "Lio/jsonwebtoken/impl/lang/Services;loadFirst(Ljava/lang/Class;)Ljava/lang/Object;"))
public Object removeServicesSupport(Class<?> spi) {
return new GsonDeserializer<>();
}