Skip to content

Conversation

@logan-mcduffie
Copy link

@logan-mcduffie logan-mcduffie commented Jan 15, 2026

Summary

  • Implement support for Mixin @Accessor and @Invoker annotations
  • @Accessor enables mods to generate getter/setter methods for private instance fields
  • @Invoker enables mods to call private methods on target classes
  • Add SyntheticClassRegistry to manage Mixin-generated synthetic classes that don't exist on disk
  • Update BytecodeProvider and ClassProvider to handle synthetic class generation and loading

Technical Details

Accessor and invoker mixins work by generating synthetic classes at runtime. Since Hytale's TransformingClassLoader only transforms classes that exist on disk, this PR adds infrastructure to:

  1. Intercept requests for synthetic accessor/invoker classes
  2. Generate them via Mixin's transformer
  3. Define them using a runtime class loader

Known Limitation: Static accessor methods are not supported due to Java requiring method bodies in interface static methods, which conflicts with Mixin's SubType classification system. This is a minor limitation since static fields typically have public getters.

Implement support for Mixin @Accessor annotations, allowing mods to
generate getter/setter methods for private instance fields on target
classes.

Key changes:
- Add SyntheticClassRegistry to manage Mixin-generated accessor classes
- Update BytecodeProvider to handle synthetic class generation
- Update ClassProvider to load synthetic classes at runtime
- Update LaunchEnvironment with helper for runtime class loading

Limitation: Static accessor methods are not supported due to Java
requiring method bodies in interface static methods, which conflicts
with Mixin's SubType classification system.
@logan-mcduffie logan-mcduffie changed the title Add @Accessor mixin support Add @Accessor and @Invoker mixin support Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant