Skip to content

Commit

Permalink
change: Mark mod defining to children options if parent was mod defined
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Jul 17, 2023
1 parent ae0d9a3 commit 6eb8898
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,12 @@ private void applyChildOptionsStateChecks() {
for (Option parentOption : this.options.values()) {
for (Option childOption : this.options.values()) {
if (childOption.getName().startsWith(parentOption.getName() + '.') && childOption != parentOption) {
// Marks every child to parent state
if (childOption.isOverrideable() && (parentOption.isUserDefined() || parentOption.isModDefined())) {
childOption.setEnabled(parentOption.isEnabled(), parentOption.isUserDefined());
if (parentOption.isModDefined()) {
parentOption.getDefiningMods().forEach(mod -> childOption.addModOverride(parentOption.isEnabled(), mod));
}
} else {
if (parentOption.isUserDefined()) {
LOGGER.warn("User attempted to override option '{}' that is not overrideable by overriding '{}', ignoring", childOption.getName(), parentOption.getName());
Expand Down

0 comments on commit 6eb8898

Please sign in to comment.