RuochenFu21 / CreateAppliedKinetics

AE2's integration with Create
MIT License
4 stars 3 forks source link

[1.20.1] Move recipes to using the forge conditional recipes system #5

Closed ChiefArug closed 1 month ago

ChiefArug commented 5 months ago

Straight port of https://github.com/RuochenFu21/CreateAppliedKinetics/pull/4 to 1.20.1

This fixes #3 on 1.19.2 as the recipe never loads instead of loading a bad json.

This also allows a config option to disable recipe overwriting, which has been added to the new common config file. It is common because server configs actually load after recipes, and the conditions are checked when recipes load. Because Forge configs support hot reloading, you can modify and save the config (not using notepad++, known bug in Forge) and then /reload to toggle this config option without needing a game restart. This also means the new recipes keep the same recipe id, for any mods that reference recipes that way. A config option is prefferable to the old datapack option as disabling the datapack cannot be done without first loading it, then reloading all game data with it disabled, which can be laggy in big packs or low end computers. A config option could also be added to not load the datapack (by checking the value in the pack finder), which would not have those issues, but I chose to go for the recipe condition option instead.

Finally there is some cleanup. There was a line in the mod constructor to add it to the main event bus, but no listeners, which has been removed. All the recipes involving crystal seeds have been removed, as the seed items no longer exist (this was causing a fair amount of spam in the log too). There are new recipes involving the new crystal growing blocks, however I have not added those and have left those to the author to add.

If this PR is not accepted due to the author preffering the datapack system, at least change your disabling jsons to this:

{"conditions": [{"type": "forge:false"}]}

which prevents the recipe from loading or erroring and also solves #3.