Skip to content

Adapter #57

Open
Open

Description

@Olafcio1

Auto-patcher for Avoid addons to:

  • update all net.minecraft usages when running on a newer version than the target,
  • update all net.minecraft usages when modified by the running platform (e.g. NeoForge).
I want to name this Adapter as I think in Sinytra Connector there's also an Adapter which I think does the second thing sort of.

Usage in this case means:

  Type Notes
 a) name reference ClassReader#readClass
 b) name in type reference descriptors, generics
 c) mixin references *see below*

Here are all the mixin references:

  Reference Target Kind
 a) @Mixin(Minecraft.class) class type
 b) @Mixin(targets = "net.minecraft.client.Minecraft") class literal
 c) @[any injector](method = "<init>") method descriptor
 d) @At(target = "Lnet/minecraft/client/Minecraft;close()V") annotation value descriptor
 e) @Shadow field, method descriptor of annotated element

TODO add constants and stuff

Now, how to recognize injectors:

var klass = Class.forName(annotation.descriptor().replace("/", "."));
var methods = klass.getDeclaredMethods();

return Arrays.stream(methods).filter(m => m.getName().equals("method") && m.getReturnType().equals(String.class)).findAny().isPresent() &&
       Arrays.stream(methods).filter(m => m.getName().equals("at") && m.getReturnType().equals(At.class)).findAny().isPresent()

Activity

  1. added
    major
    on Oct 20, 2026
  2. added this to the net.minecraft milestone on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    major

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions