Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add registerConfig method to ModContainer #99

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

dhyces
Copy link
Contributor

@dhyces dhyces commented Mar 20, 2024

Adds a method to ModContainer to create and add a mod config from a given type and spec. This is added to simplify the current verbose addConfig method. I understand that the config system is currently being looked at for a future refactor and as such recognize that the lifetime of this method may be short.

@neoforged-pr-publishing
Copy link

  • Publish PR to GitHub Packages

@ChampionAsh5357
Copy link
Contributor

I would also add the method to change the filename of the config and redirect the ModLoadingContext methods to use these new methods within the container.

@dhyces
Copy link
Contributor Author

dhyces commented Mar 20, 2024

I would also add the method to change the filename of the config and redirect the ModLoadingContext methods to use these new methods within the container.

Yeah, I don't see why not. Aside from that, should anything be done with the validation currently in the ModLoadingContext methods? Could move it into addConfig, unless there is a case to register an empty mod config, or can change it to only log a warning without early return.

@ChampionAsh5357
Copy link
Contributor

Yeah, I don't see why not. Aside from that, should anything be done with the validation currently in the ModLoadingContext methods? Could move it into addConfig, unless there is a case to register an empty mod config, or can change it to only log a warning without early return.

Since #addConfig didn't have the validation in the first place, I would leave it alone. However, they can be moved to the two methods you created.

Copy link
Member

@Technici4n Technici4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please move the isEmpty check to the new methods as well, and deprecate the old methods for removal?

@dhyces dhyces requested a review from Technici4n March 24, 2024 17:20
@Technici4n Technici4n merged commit 76df451 into neoforged:main Mar 25, 2024
2 checks passed
@dhyces dhyces deleted the feat/register-method branch March 25, 2024 20:34
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.

4 participants