-
Notifications
You must be signed in to change notification settings - Fork 0
qcompat
qloak edited this page May 13, 2026
·
1 revision
Soft dependency stubs. These compile against the APIs but don't crash if the mod isn't present.
JEIPluginBase.registerRecipeCategory(...);
JEIPluginBase.registerRecipeClickArea(...);Stubs that delegate to the actually loaded recipe viewer. Only one will be active.
CuriosCompat.getSlot(player, "ring").ifPresent(stack -> {
// do something with ring
});Returns Optional.empty() if neither API is loaded.
ModCompat.scan();Checks for known mods at startup and logs which APIs are available. Called automatically by QLibs.init().
- Create a stub interface in
common/with a no-op default. - Create platform implementations in
fabric/andneoforge/that checkPlatform.isModLoaded(). - Use
@ExpectPlatformif the implementation differs between loaders.