Skip to content

Commit

Permalink
Claritas now reports MOD, CORE_MOD, TWEAKER, or UNKNOWN for ForgeMods…
Browse files Browse the repository at this point in the history
… 1.12-.
  • Loading branch information
dscalzi committed Sep 5, 2020
1 parent 59d3744 commit 7c099f7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
Binary file modified libraries/java/Claritas.jar
Binary file not shown.
28 changes: 23 additions & 5 deletions src/model/claritas/ClaritasResult.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
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 {
Expand Down
13 changes: 13 additions & 0 deletions src/model/struct/model/module/forgemod/forgemod17.struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7c099f7

Please sign in to comment.