Skip to content

Conversation

@rlnt
Copy link

@rlnt rlnt commented Jan 3, 2026

This pull request introduces integration for Almost Unified.

I tried integrating it with the existing ModCompat system. Feel free to remove it and just make use of the AlmostUnifiedAdapter. It already guards against class access if the mod is not loaded via the nested static class. The implementation makes Almost Unified a soft dependency.

The current use case is the ItemStackFromIngredient class, which will make use of the adapter to resolve the stored tag to the preferred item. I would suggest not caching the resolved stack in the class in case the Almost Unified config changes (the mod is fully reloadable). The performance impact should be negligible because it's a simple map lookup on our side.

I tested the implementation with Integrated Dynamics via Maven local. The Mechanical Squeezer makes use of the ItemStackFromIngredient class for its outputs. I was able to fully reload config changes and see the expected results in the recipe. The mod still works normally if Almost Unified is not present.
Because Almost Unified takes priority over its own mod priority system, it may be a good idea to mention this in the config option right here: https://github.com/CyclopsMC/IntegratedDynamics/blob/master-1.21-lts/src/main/java/org/cyclops/integrateddynamics/GeneralConfig.java#L127-L128

If Almost Unified can't provide the preferred item for the tag, the implementation will fall back to the previous behavior. This integration simplifies modpack work because it fetches the mod priorities from a single point of truth. To fully support all features of Almost Unified, I may add a pull request to Integrated Dynamics too.

@CLAassistant
Copy link

CLAassistant commented Jan 3, 2026

CLA assistant check
All committers have signed the CLA.

@rubensworks
Copy link
Member

Thanks for the PR @rlnt.

When I said I was open to changes, I had in mind a new interface or hook or so 😅
In general, I'm not a big fan of adding dev dependencies on other mods, as it increases my maintenance and MC version porting effort quite substantially (I also dislike the Curios support in here for example), especially since CyclopsCore is the base mod for all my other mods.

What we could do instead, is introducing a new event in CyclopsCore (e.g. TagToItemStackEvent?) that is emitted to the event bus in ItemStackFromIngredient. Then you could easily handle to that event in Almost Unified.
That should make things a lot easier on your end, as I suspect you currently have to solve this through a mixin.
Would you be open to this?

To fully support all features of Almost Unified, I may add a pull request to Integrated Dynamics too.

What features are this exactly? Would TagToItemStackEvent be sufficient to capture these?

@rlnt
Copy link
Author

rlnt commented Jan 4, 2026

Thanks for the response. I understand that you want to avoid additional dev dependencies because of porting, even if the maintenance would only include a single line.

An alternative I could offer is to add support to Integrated Dynamics directly. It would involve a custom Almost Unified plugin that is loaded via an annotation and doesn't require additional wiring in on the mod side, thus making the integration completely optional and easy to maintain. If Almost Unified is not up to date, you can just comment out the code. The plugin involves a custom unifier that you register for your recipe types. It tells Almost Unified how to handle the recipe JSONs. Since you serializers seem to support output stacks as well, we could replace the tag outputs with stack outputs directly, which would have the same effect as this pull request.

Would that be a better option?

A TagToItemStackEvent might not be a bad idea for the future. I'll add that to my notes. Adding it to Cyclops wouldn't be suitable, though. Since Almost Unified works on raw JSON, it never depends on mods, because it would result in the same issues (difficult to port and maintain).

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