Infernal-Expansion icon indicating copy to clipboard operation
Infernal-Expansion copied to clipboard

Soul Fire'd API integration (1.19.2)

Open Crystal-Spider opened this issue 2 years ago • 2 comments

Soul Fire'd is a mod of mine with a dual aim:

  1. Add actually unique properties to Soul Fire.
  2. Provide an easy-to-use API for other mods to register their own, or even of other mods, custom fires and having everything automatically handled.

I saw that Infernal Expansion can benefit in both cases as it currently is:

  • Having its own small API to register some specific fires, either its owns, of other mods, or of Minecraft.
  • Handling fires visual effects and some other fire-related stuff.

By integrating the Soul Fire'd API, Infernal Expansion gets more streamlined code, removal of some mixins, easier fire handling, and more optional features (e.g. enchantments handling, easy fire source and campfire handling, etc.).
Furthermore, Vanilla fire and soul fire are already handled without needing explicit references in your code.
I also plan to expand the ecosystem with further PRs to other mods, such that they are all compatible with each other and there's less need for you to register others' fires.

If this PR is accepted, I will also start working for 1.16.5 and 1.18.2 PRs (or for whichever branch is better, maybe release-3.0?).

Lastly, I know it's not always the best to add dependency to other mods as that might slow down future versions rollouts, but I can assure you, as the Soul Fire'd API developer, that it's always going to come out very soon for newer versions (and you can already see it by the wide range of Minecraft versions supported and actively mantained).

Let me know if I did anything wrong when contributing or if something is not clear, or really anything in general.

Changes summary:

  • build.gradle Added Soul Fire'd dependency.

  • Mixins Removed MixinEntityRendererManager, MixinOverlayRenderer, and MixinEntity.
    Changed MixinModelBakery and MixinAbstractFireBlock (removed now useless bits).

  • Old fire internal API Removed FireTypeAccess, FireType, and ClientFireType. Changed registration of fires in IEFireTypes.

Crystal-Spider avatar Oct 17 '23 17:10 Crystal-Spider

I want to add that since version 3.2.0.0 it's also possible to introduce a soft dependency with a datapack rather than as I did with code.
I did it with code because anyway I had to rework how fires were handled in IE, but it could also be possible to remove entirely the code that handles fires and use a datapack instead.
In the datapack case, and because in IE the fire mechanics are required, Soul Fire'd would still need to be listed as a required dependency to make everything work as needed.

Crystal-Spider avatar Dec 31 '23 16:12 Crystal-Spider

Little update: I opened a while ago a similar PR to BYG and they recently merged it and they are now in the process of porting SF dependency to all supported Minecraft versions.

This means:

  1. SF ecosystem is indeed expanding.
  2. BYG fire handling won't be explicitly needed anymore: just requiring SF as a dependency of IE will ensure that, when BYG is installed, its fires are handled too!

As soon as BYG releases a new version with the changes from the PR, I'll make sure to update the code of this PR too to remove the now useless BYG fire handling.

Crystal-Spider avatar Feb 14 '24 21:02 Crystal-Spider