Skip to content

Instantly share code, notes, and snippets.

@maruohon
Created January 12, 2024 21:29
Show Gist options
  • Save maruohon/de66fceed4afe6d1c304897a06fc440d to your computer and use it in GitHub Desktop.
Save maruohon/de66fceed4afe6d1c304897a06fc440d to your computer and use it in GitHub Desktop.
malilib config locks mockup
{
// NOTE: Do not leave the comments to an actual live config, they will break the parser!
"malilib_config_overrides":
[
{
// Optional. If not specified, then targets all mods by default. Accepts a regex targeting mod IDs.
"mod": ".*",
// Optional. If not specified, then targets all categories by default.
// Accepts a regex targeting the category name. Checked after the mod check.
"category": ".*",
// Optional. If present and set to "override", forces an override value for all the features from the matched mods.
// Allowed values are "override", and anything else is considered as "allow" (= "don't override").
// The overrides list below can be used to override the default policy for selected features.
"policy": "override",
// This should be present if the "policy" is set to "override".
// This is the default value override for all the matched features.
// The overrides list below can be used to override the policy or this default override value for specific features.
"override_value": false,
// Optional. Can add a message that is visible to the user in the config menu for each overridden config option.
// Note that this only makes sense when disallowing/overriding features, it's not visible for features that are allowed/not overridden.
"message": "This server does now allow using this feature, as it's considered too powerful and cheaty and non-vanilla",
// Optional. Accepts a regex targeting the config names.
// This takes precedence over the "names" + "name_prefix"/"name_suffix".
"name_regex": "debug.*", // Optional. Can target multiple features via a regex.
// Optional. Can be used to append a common prefix to all the names on the "names" list.
// Does nothing if "name_regex" is present.
"name_prefix": "tweak",
// Optional. Can be used to append a common suffix to all the names on the "names" list.
// Does nothing if "name_regex" is present.
"name_suffix": "Config",
// Optional. Targets individual features by name. The "name_prefix" and "name_suffix"
// can be used to append a prefix and/or a suffix to all the names on the list.
// Does nothing if "name_regex" is present, as that one has precedence over this.
"names": [ "FooBar", "SomeThing" ],
// Optional. Overrides the default override_value for specific mods or features.
// The overrides are applied in the list order, so it's valid to first target
// a broader feature set and then override that value for individual features.
// Note that the overrides will inherit the mod and message values from
// the upper definition, if they are not set here.
// Note that one of "name_regex" or "features" should be present for the override
// to be able to target a different set of features than the parent definition.
"overrides":
[
{
// Optional. If not specified, then this is done for all mods targeted by the above mod filter.
"mod": "tweakeroo",
// Optional. If present and set to "override", forces an override value for all the features from the matched mods.
// Allowed values are "override", and anything else is considered as "allow" (= "don't override").
"policy": "override",
// Required if the policy is set to "override". Specifies the override value.
// Usually should be different from the default override_value for it to do anything.
// However subsequent overrides may want to revert a previous more broad override specification.
"override_value": false,
// Optional. Can add a message that is visible to the user in the config menu
// for each overridden config option. Note that this only makes sense when disallowing/overriding features.
"message": "This server does now allow using this feature, as it's considered too powerful and cheaty and non-vanilla",
// Optional. Can target multiple features via a regex.
// This takes precedence over the "names" + "name_prefix"/"name_suffix".
"name_regex": "debug.*",
// Optional. Can be used to append a common prefix to all the names on the "names" list.
// Does nothing if "name_regex" is present.
"name_prefix": "tweak",
// Optional. Can be used to append a common suffix to all the names on the "names" list.
// Does nothing if "name_regex" is present.
"name_suffix": "Config",
// Optional. Targets individual features by name. The "name_prefix" and "name_suffix"
// can be used to append a prefix and/or a suffix to all the names on the list.
// Does nothing if "name_regex" is present, as that one has precedence over this.
"names": [ "FooBar", "SomeThing" ]
}
]
},
{
"mod": "minihud",
"policy": "allow",
"overrides":
[
{
"policy": "override",
"override_value": false,
"names": [ "infoSlimeChunk", "infoFooBar" ]
}
]
},
{
"mod": "tweakeroo",
"policy": "allow",
"overrides":
[
{
"policy": "override",
"override_value": false,
"category": "TweakToggles"
},
{
"policy": "allow",
"category": "TweakToggles",
"names": [ "tweakF3Cursor", "tweakMapPreview" ]
}
]
},
{
"mod": "litematica",
"policy": "allow",
"overrides":
[
{
"policy": "override",
"override_value": false,
"names": [ "easyPlaceMode" ]
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment