Skip to content

added api for creating custom sugar types - #146

Closed
TheTypholorian wants to merge 1 commit into
LlamaLad7:masterfrom
TheTypholorian:master
Closed

TheTypholorian wants to merge 1 commit into
LlamaLad7:masterfrom
TheTypholorian:master

Conversation

@TheTypholorian

Copy link
Copy Markdown

Injection info and injection point both have a public static system to register custom versions of both. Meanwhile, mixin extras sugars are locked down. This PR makes necessary methods in SugarApplicator protected rather than package private, and adds a public static register method.

@cputnam-a11y

Copy link
Copy Markdown

Llama has previously said that injectors being extensible outside of mixin was a mistake, so I expect that this will follow suit

@TheTypholorian

Copy link
Copy Markdown
Author

Llama has previously said that injectors being extensible outside of mixin was a mistake, so I expect that this will follow suit

ugh that's annoying
guess I'm stuck with using a java agent to make my own sugars

@cputnam-a11y

Copy link
Copy Markdown

or reflection

@TheTypholorian

Copy link
Copy Markdown
Author

or reflection

well I need to override package private methods in SugarApplicator and reflection can't do that afaik, so I need my own AW-like system since fabric restricts AWs to minecraft classes

@cputnam-a11y

cputnam-a11y commented Sep 17, 2026 •

Copy link
Copy Markdown

or reflection

well I need to override package private methods in SugarApplicator and reflection can't do that afaik, so I need my own AW-like system since fabric restricts AWs to minecraft classes

as long as jpms is not a factor, reflection can override package private methods via MethodHandles$Lookup#defineHiddenClass
I recommend OpenSesame if you need to do this

@TheTypholorian

Copy link
Copy Markdown
Author

as long as jpms is not a factor, reflection can override package private methods via MethodHandles$Lookup#defineHiddenClass I recommend OpenSesame if you need to do this

that's very helpful, tysm!

@LlamaLad7

Copy link
Copy Markdown
Owner

Yeah this will not be supported, as with injectors it is impossible to have perfect compat if mods add their own.

@LlamaLad7 LlamaLad7 closed this Sep 17, 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.

3 participants