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
@Darkhax
Copy link
Collaborator

Darkhax commented Jan 21, 2026

Synthetics are one issue, but this is a symptom of a larger known issue. Early plugin code, and by extension Mixin, its dependencies, and any generated classes do not exist on the runtime classloader. This is a known caveat, and something we have been working to address in the background, well before the game launched.

The upstream version runs within the normal plugin environment as intended, resolving these issues and allowing normal plugins to use Mixins without being loaded as early plugins. The main drawback is that normal plugins are only available after the majority of the game has already been loaded, so we need to decide the best way to preload plugins with mixins.

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.

2 participants