mirror of
https://github.com/Kir-Antipov/mc-publish.git
synced 2024-11-22 00:11:02 -05:00
Fabric mods can be marked as Quilt-compatible
This commit is contained in:
parent
411eed8f51
commit
03cc643a6e
2 changed files with 25 additions and 2 deletions
18
README.md
18
README.md
|
@ -525,7 +525,23 @@ changelog-file: CHANGELOG.md
|
|||
|
||||
#### loaders
|
||||
|
||||
A list of supported mod loaders. If no value is provided, `fabric` will be used for valid Fabric mods, `forge` will be used for valid Forge mods, and `quilt` will be used for valid Quilt mods.
|
||||
A list of supported mod loaders. If no value is provided, `fabric` will be used for valid Fabric mods, `forge` will be used for valid Forge mods, `quilt` will be used for valid Quilt mods, and `fabric, quilt` will be used for Fabric mods that were marked as Quilt-compatible.
|
||||
|
||||
Fabric mods can be marked as Quilt-compatible like so:
|
||||
|
||||
- `fabric.mod.json`
|
||||
```json
|
||||
{
|
||||
// ...
|
||||
"custom": {
|
||||
"mc-publish": {
|
||||
"quilt": true
|
||||
}
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
```yaml
|
||||
loaders: |
|
||||
|
|
|
@ -39,6 +39,13 @@ function getDependenciesByKind(config: any, kind: DependencyKind): Dependency[]
|
|||
return dependencies;
|
||||
}
|
||||
|
||||
function getLoaders(config: any): string[] {
|
||||
if (config[action.name]?.quilt ?? config.custom?.[action.name]?.quilt) {
|
||||
return ["fabric", "quilt"];
|
||||
}
|
||||
return ["fabric"];
|
||||
}
|
||||
|
||||
export default class FabricModMetadata extends ModConfig {
|
||||
public readonly id: string;
|
||||
public readonly name: string;
|
||||
|
@ -51,7 +58,7 @@ export default class FabricModMetadata extends ModConfig {
|
|||
this.id = String(this.config.id ?? "");
|
||||
this.name = String(this.config.name ?? this.id);
|
||||
this.version = String(this.config.version ?? "*");
|
||||
this.loaders = ["fabric"];
|
||||
this.loaders = getLoaders(this.config);
|
||||
this.dependencies = DependencyKind.getValues().flatMap(x => getDependenciesByKind(this.config, x));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue