diff --git a/libraries/java/Claritas.jar b/libraries/java/Claritas.jar index a86fb5b..29ed747 100644 Binary files a/libraries/java/Claritas.jar and b/libraries/java/Claritas.jar differ diff --git a/src/model/struct/model/module/litemod.struct.ts b/src/model/struct/model/module/litemod.struct.ts index 932b3bd..efc0500 100644 --- a/src/model/struct/model/module/litemod.struct.ts +++ b/src/model/struct/model/module/litemod.struct.ts @@ -8,6 +8,7 @@ import { LiteMod } from '../../../liteloader/litemod' import { ToggleableModuleStructure } from './toggleablemodule.struct' import { MinecraftVersion } from '../../../../util/MinecraftVersion' import { LibraryType } from '../../../claritas/ClaritasLibraryType' +import { MetadataUtil } from '../../../../util/MetadataUtil' export class LiteModStructure extends ToggleableModuleStructure { @@ -28,7 +29,8 @@ export class LiteModStructure extends ToggleableModuleStructure { protected async getModuleId(name: string, path: string): Promise { const liteModData = await this.getLiteModMetadata(name, path) - return this.generateMavenIdentifier(this.getClaritasGroup(path), liteModData.name, `${liteModData.version}-${liteModData.mcversion}`) + return this.generateMavenIdentifier( + MetadataUtil.completeGroupInference(this.getClaritasGroup(path), liteModData.name), liteModData.name, `${liteModData.version}-${liteModData.mcversion}`) } protected async getModuleName(name: string, path: string): Promise { return capitalize((await this.getLiteModMetadata(name, path)).name) diff --git a/src/util/MetadataUtil.ts b/src/util/MetadataUtil.ts new file mode 100644 index 0000000..a94af45 --- /dev/null +++ b/src/util/MetadataUtil.ts @@ -0,0 +1,21 @@ +export class MetadataUtil { + + public static completeGroupInference(partial: string, id: string): string { + + const bits = partial.split('.') + + let isBadTerm = true + while(isBadTerm && bits.length > 2) { + const term = bits[bits.length-1] + if(term !== id) { + isBadTerm = false + } else { + bits.pop() + } + } + + return bits.join('.') + + } + +} \ No newline at end of file