-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Extend requirement groups #56323
Extend requirement groups #56323
Conversation
I'm sure there is a good reason for this, but why not use the |
I guess I didn't think of it :P I'm pretty sure those are provided by |
62b7988
to
bdd3820
Compare
bdd3820
to
61bf7d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good for the aftershock changes. Thank you this is really cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it thanks!
61bf7d3
to
a0ae8cc
Compare
a0ae8cc
to
84321c9
Compare
Failed monster attack test doesn't look related |
Summary
None
Purpose of change
LyleSY ran into a limitation of requirements in #56319:
Requirement groups can only be overwritten, meaning that two mods modifying the same requirement id will overwrite each other.
Describe the solution
Add an optional field to requirements to extend the list:
Using
"extend"
causes the currently loaded requirement to integrate the given list.Describe alternatives you've considered
This could be implemented as a set of requirements per id (one for each
src
), but that would require a significant overhaul of the rest of the codebase. This is just the simplest option.I also tried making requirements extend by default, but inline requirement id's (generated at load time) tend to cause problems. There's no clean way to distinguish a generated id from a manually created id (other than the prefix on generated id's).
Testing
Added some test cases to check that extended requirements are properly added:
Manual testing: Loading a recipe that extends
eggs_bird
for DinoMod and Magiclysm.Additional context
TODO:
extend
syntax (thanks Maddremor)