Prevent mixin.perf suboptions from defaulting to on if an explicit
option is not added
This commit is contained in:
parent
4ea7b864a8
commit
546d1df48f
|
|
@ -97,7 +97,11 @@ public class ModernFixMixinPlugin implements IMixinConfigPlugin {
|
||||||
Option option = instance.config.getEffectiveOptionForMixin(mixin);
|
Option option = instance.config.getEffectiveOptionForMixin(mixin);
|
||||||
|
|
||||||
if (option == null) {
|
if (option == null) {
|
||||||
this.logger.error("No rules matched mixin '{}', treating as foreign and disabling!", mixin);
|
String msg = "No rules matched mixin '{}', treating as foreign and disabling!";
|
||||||
|
if(ModernFixPlatformHooks.isDevEnv())
|
||||||
|
this.logger.error(msg, mixin);
|
||||||
|
else
|
||||||
|
this.logger.debug(msg, mixin);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,10 +128,17 @@ public class ModernFixEarlyConfig {
|
||||||
List<String> mixinOptionNames = dotSplitter.splitToList(mixinClassName);
|
List<String> mixinOptionNames = dotSplitter.splitToList(mixinClassName);
|
||||||
StringBuilder optionBuilder = new StringBuilder(mixinClassName.length());
|
StringBuilder optionBuilder = new StringBuilder(mixinClassName.length());
|
||||||
optionBuilder.append("mixin");
|
optionBuilder.append("mixin");
|
||||||
|
// mixin.core, mixin.safety can be top-level, everything else must have a subcategory
|
||||||
|
boolean allowTopLevel;
|
||||||
|
if(mixinOptionNames.size() > 0)
|
||||||
|
allowTopLevel = mixinOptionNames.get(0).equals("core") || mixinOptionNames.get(0).equals("safety");
|
||||||
|
else
|
||||||
|
allowTopLevel = false;
|
||||||
for(int i = 0; i < mixinOptionNames.size() - 1; i++) {
|
for(int i = 0; i < mixinOptionNames.size() - 1; i++) {
|
||||||
optionBuilder.append('.');
|
optionBuilder.append('.');
|
||||||
optionBuilder.append(mixinOptionNames.get(i));
|
optionBuilder.append(mixinOptionNames.get(i));
|
||||||
mixinOptions.add(optionBuilder.toString());
|
if(i > 0 || allowTopLevel)
|
||||||
|
mixinOptions.add(optionBuilder.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch(IOException e) {
|
} catch(IOException e) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user