Claritas now reports MOD, CORE_MOD, TWEAKER, or UNKNOWN for ForgeMods 1.12-.

This commit is contained in:
Daniel Scalzi
2020-09-05 18:52:44 -04:00
parent 59d3744f56
commit 7c099f749d
3 changed files with 36 additions and 5 deletions

View File

@@ -1,24 +1,42 @@
export interface ClaritasModuleMetadata {
/**
* Present on ForgeMods
* Present on ForgeMods (1.7-1.12) of type MOD.
* Possibly present on ForgeMods (1.7-1.12) of type CORE_MOD.
* Always present on ForgeMods 1.13+.
* Never present in all other circumstances.
*/
id?: string
/**
* Always Present
* Never present on ForgeMods (1.7-1.12) of type UNKNOWN.
* Present in all other circumstances.
*/
group: string
group?: string
/**
* Possibly present on ForgeMods 1.12-
* Possibly present on ForgeMods (1.7-1.12).
* Never present in all other circumstances.
*/
version?: string
/**
* Possibly present on ForgeMods 1.12-
* Possibly present on ForgeMods (1.7-1.12).
* Never present in all other circumstances.
*/
name?: string
/**
* Always present on ForgeMods (1.7-1.12).
* Never present in all other circumstances.
*/
modType?: ForgeModType_1_7
}
export enum ForgeModType_1_7 {
MOD = 'MOD',
CORE_MOD = 'CORE_MOD',
TWEAKER = 'TWEAKER',
UNKNOWN = 'UNKNOWN'
}
export interface ClaritasResult {
[jarPath: string]: ClaritasModuleMetadata | undefined

View File

@@ -5,6 +5,7 @@ import { McModInfo } from '../../../../forge/mcmodinfo'
import { McModInfoList } from '../../../../forge/mcmodinfolist'
import { BaseForgeModStructure } from '../forgemod.struct'
import { MinecraftVersion } from '../../../../../util/MinecraftVersion'
import { ForgeModType_1_7 } from '../../../../claritas/ClaritasResult'
export class ForgeModStructure17 extends BaseForgeModStructure {
@@ -131,6 +132,18 @@ export class ForgeModStructure17 extends BaseForgeModStructure {
if(cRes == null) {
this.logger.error(`Claritas failed to yield metadata for ForgeMod ${name}!`)
this.logger.error('Is this mod malformated or does Claritas need an update?')
} else {
switch(cRes.modType!) {
case ForgeModType_1_7.CORE_MOD:
this.logger.warn(`CORE_MOD Discovered: ForgeMod ${name} has no @Mod annotation. Metadata inference capabilities are limited.`)
break
case ForgeModType_1_7.TWEAKER:
this.logger.warn(`TWEAKER Discovered: ForgeMod ${name} has no @Mod annotation. Metadata inference capabilities may be limited.`)
break
case ForgeModType_1_7.UNKNOWN:
this.logger.error(`Jar file ${name} is not a ForgeMod. Is it a library?`)
break
}
}
const claritasId = cRes?.id