Item List Integrations
Myotus exposes a small annotation set for item-list integrations in 1.20.1.
The goal is not to hide JEI, EMI, or REI completely. The goal is to keep loader-gated registration code discoverable and safe when optional dependencies are absent.
Public markers
Section titled “Public markers”Loader markers:
@JEI@EMI@REI
Additional item-list markers:
@RecipeAdd@RecipeCategory@RecipeTransfer@JEIGuiHandler
Subscriber marker:
@MyotusSubscriber
Dispatch flow
Section titled “Dispatch flow”ItemListModLoadHelper.invokeItemListMod(...) is the bridge that runs integration subscribers.
At runtime it:
- reads mod annotation metadata through
AnnotationScanner.getModAnnotations() - filters to classes carrying the requested loader marker
- wraps the class reference with
SafeClass - skips classes whose extra load-gate annotations are not currently active
- invokes static methods marked with
@MyotusSubscriber - requires the subscriber method to declare exactly one parameter of the requested registration type
That keeps optional item-list code out of the common bootstrap path while still allowing automatic discovery.
Authoring shape
Section titled “Authoring shape”@JEI@RecipeCategorypublic final class ExampleJeiCategoryRegistration { @MyotusSubscriber public static void register(IRecipeCategoryRegistration registration) { // Register JEI categories or catalysts here. }}The important rule is not the extra category marker. The important rule is that the class carries the loader marker and the method carries @MyotusSubscriber.
Practical rules
Section titled “Practical rules”- Subscriber methods must be
static. - Subscriber methods must declare exactly one parameter.
- The parameter type must match the registration type requested by the loader bridge.
SafeClassis used on the class boundary so missing optional classes fail soft instead of crashing discovery.
Relationship to optional integrations
Section titled “Relationship to optional integrations”These item-list hooks still depend on the same integration registry described in Optional Integrations.
Use the integration registry for mod availability and the item-list subscriber flow for registration callbacks.