Rubidium

Rubidium

34M Downloads

API to allow other mods to enable/disable certain mixins selectively is commented out and unimplemented.

alcatrazEscapee opened this issue ยท 2 comments

commented

I would like to disable mixin.feature.fast_biome_colors, as indicated here, with a specific mod present, as it breaks the sky color of said mod. Unfortunately, this API is commented out and unimplemented with no alternative presented:

/*private void applyModOverrides() {
for (ModContainer container : FabricLoader.getInstance().getAllMods()) {
ModMetadata meta = container.getMetadata();
if (meta.containsCustomValue(JSON_KEY_SODIUM_OPTIONS)) {
CustomValue overrides = meta.getCustomValue(JSON_KEY_SODIUM_OPTIONS);
if (overrides.getType() != CustomValue.CvType.OBJECT) {
LOGGER.warn("Mod '{}' contains invalid Sodium option overrides, ignoring", meta.getId());
continue;
}
for (Map.Entry<String, CustomValue> entry : overrides.getAsObject()) {
this.applyModOverride(meta, entry.getKey(), entry.getValue());
}
}
}
}
private void applyModOverride(ModMetadata meta, String name, CustomValue value) {
Option option = this.options.get(name);
if (option == null) {
LOGGER.warn("Mod '{}' attempted to override option '{}', which doesn't exist, ignoring", meta.getId(), name);
return;
}
if (value.getType() != CustomValue.CvType.BOOLEAN) {
LOGGER.warn("Mod '{}' attempted to override option '{}' with an invalid value, ignoring", meta.getId(), name);
return;
}
boolean enabled = value.getAsBoolean();
// disabling the option takes precedence over enabling
if (!enabled && option.isEnabled()) {
option.clearModsDefiningValue();
}
if (!enabled || option.isEnabled() || option.getDefiningMods().isEmpty()) {
option.addModOverride(enabled, meta.getId());
}
}*/

commented

1c6cc83
Will be added in next release