diff --git a/README.md b/README.md index f64adfe..d7146e9 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ __*SubCommands*__ #### Generate Server -Generate an new server in the root directory. Options are provided to include forge/liteloader in the generated server. +Generate an new server in the root directory. Options are provided to include forge in the generated server. `generate server ` @@ -113,9 +113,6 @@ Options: * OPTIONAL (default: null) * If not provided forge will not be enabled. * You can provide either `latest` or `recommended` to use the latest/recommended version of forge. -* `--liteloader ` Specify liteloader version. - * OPTIONAL (default: null) - * If not provided liteloader will not be enabled. > > Example Usage @@ -215,8 +212,6 @@ Ex. * `libraries` All modules of type `Library` * `forgemods` All modules of type `ForgeMod`. * This is a directory of toggleable modules. See the note below. - * `litemods` All modules of type `LiteMod`. - * This is a directory of toggleable modules. See the note below. * `TestServer-1.12.2.png` Server icon file. #### Toggleable Modules @@ -315,7 +310,7 @@ In the above example, all files of type `cfg` in the config directory will be un ] }, { - "appliesTo": ["forgemods", "litemods"], + "appliesTo": ["forgemods"], "patterns": [ "optionalon/*.jar" ] @@ -324,7 +319,7 @@ In the above example, all files of type `cfg` in the config directory will be un } ``` -Another example where all `optionalon` forgemods and litemods are untracked. **Untracking mods is NOT recommended. This is an example ONLY.** +Another example where all `optionalon` forgemods are untracked. **Untracking mods is NOT recommended. This is an example ONLY.** ### Note on JSON Schemas diff --git a/libraries/java/Claritas.jar b/libraries/java/Claritas.jar index 46c9b4a..90badf6 100644 Binary files a/libraries/java/Claritas.jar and b/libraries/java/Claritas.jar differ diff --git a/src/index.ts b/src/index.ts index a2ea641..32f0608 100644 --- a/src/index.ts +++ b/src/index.ts @@ -174,19 +174,13 @@ const generateServerCommand: yargs.CommandModule = { type: 'string', default: null }) - .option('liteloader', { - describe: 'LiteLoader version.', - type: 'string', - default: null - }) }, handler: async (argv) => { argv.root = getRoot() logger.debug(`Root set to ${argv.root}`) logger.debug(`Generating server ${argv.id} for Minecraft ${argv.version}.`, - `\n\t├ Forge version: ${argv.forge}`, - `\n\t└ LiteLoader version: ${argv.liteloader}`) + `\n\t└ Forge version: ${argv.forge}`) const minecraftVersion = new MinecraftVersion(argv.version as string) @@ -204,8 +198,7 @@ const generateServerCommand: yargs.CommandModule = { argv.id as string, minecraftVersion, { - forgeVersion: argv.forge as string, - liteloaderVersion: argv.liteloader as string + forgeVersion: argv.forge as string } ) diff --git a/src/model/claritas/ClaritasLibraryType.ts b/src/model/claritas/ClaritasLibraryType.ts index 14b5e3e..08257ec 100644 --- a/src/model/claritas/ClaritasLibraryType.ts +++ b/src/model/claritas/ClaritasLibraryType.ts @@ -1,6 +1,5 @@ export enum LibraryType { - FORGE = 'FORGE', - LITELOADER = 'LITELOADER' + FORGE = 'FORGE' } \ No newline at end of file diff --git a/src/model/liteloader/litemod.ts b/src/model/liteloader/litemod.ts deleted file mode 100644 index 9cf99f4..0000000 --- a/src/model/liteloader/litemod.ts +++ /dev/null @@ -1,10 +0,0 @@ -export interface LiteMod { - - name: string - version: string - mcversion: string - revision: string - description: string - author?: string - -} diff --git a/src/model/nebula/servermeta.ts b/src/model/nebula/servermeta.ts index cb8bc1d..2446724 100644 --- a/src/model/nebula/servermeta.ts +++ b/src/model/nebula/servermeta.ts @@ -14,7 +14,6 @@ export interface UntrackedFilesOption { export interface ServerMetaOptions { forgeVersion?: string - liteloaderVersion?: string } export function getDefaultServerMeta(id: string, version: string, options?: ServerMetaOptions): ServerMeta { @@ -42,13 +41,6 @@ export function getDefaultServerMeta(id: string, version: string, options?: Serv } } - if(options?.liteloaderVersion) { - servMeta.meta.description = `${servMeta.meta.description} (Liteloader v${options.liteloaderVersion})` - servMeta.liteloader = { - version: options.liteloaderVersion - } - } - // Add empty untracked files. servMeta.untrackedFiles = [] @@ -81,16 +73,6 @@ export interface ServerMeta { version: string } - /** - * Properties related to liteloader. - */ - liteloader?: { - /** - * The liteloader version. - */ - version: string - } - /** * A list of option objects defining patterns for untracked files. */ diff --git a/src/structure/repo/LibRepo.struct.ts b/src/structure/repo/LibRepo.struct.ts index 0163ea4..3e70a4b 100644 --- a/src/structure/repo/LibRepo.struct.ts +++ b/src/structure/repo/LibRepo.struct.ts @@ -8,9 +8,6 @@ export class LibRepoStructure extends BaseMavenRepo { public static readonly FORGE_GROUP = 'net.minecraftforge' public static readonly FORGE_ARTIFACT = 'forge' - public static readonly LITELOADER_GROUP = 'com.mumfrey' - public static readonly LITELOADER_ARTIFACT = 'liteloader' - constructor( absoluteRoot: string, relativeRoot: string @@ -29,11 +26,4 @@ export class LibRepoStructure extends BaseMavenRepo { version, classifier, 'jar') } - public getLocalLiteLoader(version: string, classifier?: string): string { - return this.getArtifactByComponents( - LibRepoStructure.LITELOADER_GROUP, - LibRepoStructure.LITELOADER_ARTIFACT, - version, classifier, 'jar') - } - } diff --git a/src/structure/spec_model/Server.struct.ts b/src/structure/spec_model/Server.struct.ts index 22f6352..9052e95 100644 --- a/src/structure/spec_model/Server.struct.ts +++ b/src/structure/spec_model/Server.struct.ts @@ -6,7 +6,6 @@ import { VersionSegmentedRegistry } from '../../util/VersionSegmentedRegistry' import { ServerMeta, getDefaultServerMeta, ServerMetaOptions, UntrackedFilesOption } from '../../model/nebula/servermeta' import { BaseModelStructure } from './BaseModel.struct' import { MiscFileStructure } from './module/File.struct' -import { LiteModStructure } from './module/LiteMod.struct' import { LibraryStructure } from './module/Library.struct' import { MinecraftVersion } from '../../util/MinecraftVersion' import { addSchemaToObject, SchemaTypes } from '../../util/SchemaUtil' @@ -41,7 +40,6 @@ export class ServerStructure extends BaseModelStructure { minecraftVersion: MinecraftVersion, options: { forgeVersion?: string - liteloaderVersion?: string } ): Promise { const effectiveId = `${id}-${minecraftVersion}` @@ -70,12 +68,6 @@ export class ServerStructure extends BaseModelStructure { serverMetaOpts.forgeVersion = options.forgeVersion } - if (options.liteloaderVersion != null) { - const lms = new LiteModStructure(absoluteServerRoot, relativeServerRoot, this.baseUrl, minecraftVersion, []) - await lms.init() - serverMetaOpts.liteloaderVersion = options.liteloaderVersion - } - const serverMeta: ServerMeta = addSchemaToObject( getDefaultServerMeta(id, minecraftVersion.toString(), serverMetaOpts), SchemaTypes.ServerMetaSchema, @@ -159,13 +151,6 @@ export class ServerStructure extends BaseModelStructure { modules.push(...forgeModModules) } - - if(serverMeta.liteloader) { - const liteModStruct = new LiteModStructure(absoluteServerRoot, relativeServerRoot, this.baseUrl, minecraftVersion, untrackedFiles) - const liteModModules = await liteModStruct.getSpecModel() - modules.push(...liteModModules) - } - const libraryStruct = new LibraryStructure(absoluteServerRoot, relativeServerRoot, this.baseUrl, minecraftVersion, untrackedFiles) const libraryModules = await libraryStruct.getSpecModel() modules.push(...libraryModules) diff --git a/src/structure/spec_model/module/LiteMod.struct.ts b/src/structure/spec_model/module/LiteMod.struct.ts deleted file mode 100644 index 942a451..0000000 --- a/src/structure/spec_model/module/LiteMod.struct.ts +++ /dev/null @@ -1,103 +0,0 @@ -import StreamZip from 'node-stream-zip' -import { Stats } from 'fs-extra' -import { Type } from 'helios-distribution-types' -import { join } from 'path' -import { URL } from 'url' -import { capitalize } from '../../../util/stringutils' -import { LiteMod } from '../../../model/liteloader/litemod' -import { ToggleableModuleStructure } from './ToggleableModule.struct' -import { MinecraftVersion } from '../../../util/MinecraftVersion' -import { LibraryType } from '../../../model/claritas/ClaritasLibraryType' -import { MetadataUtil } from '../../../util/MetadataUtil' -import { UntrackedFilesOption } from '../../../model/nebula/servermeta' - -export class LiteModStructure extends ToggleableModuleStructure { - - private liteModMetadata: {[property: string]: LiteMod | undefined} = {} - - constructor( - absoluteRoot: string, - relativeRoot: string, - baseUrl: string, - minecraftVersion: MinecraftVersion, - untrackedFiles: UntrackedFilesOption[] - ) { - super(absoluteRoot, relativeRoot, 'litemods', baseUrl, minecraftVersion, Type.LiteMod, untrackedFiles) - } - - public getLoggerName(): string { - return 'LiteModStructure' - } - - protected async getModuleId(name: string, path: string): Promise { - const liteModData = await this.getLiteModMetadata(name, path) - 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) - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected async getModuleUrl(name: string, path: string, stats: Stats): Promise { - return new URL(join(this.relativeRoot, this.getActiveNamespace(), name), this.baseUrl).toString() - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected async getModulePath(name: string, path: string, stats: Stats): Promise { - return null - } - - protected getClaritasType(): LibraryType { - return LibraryType.LITELOADER - } - - private getLiteModMetadata(name: string, path: string): Promise { - return new Promise((resolve, reject) => { - if (!Object.prototype.hasOwnProperty.call(this.liteModMetadata, name)) { - - const zip = new StreamZip({ - file: path, - storeEntries: true - }) - - zip.on('error', err => reject(err)) - zip.on('ready', () => { - try { - const res = this.processZip(zip, name) - zip.close() - resolve(res) - return - } catch(err) { - zip.close() - reject(err) - return - } - }) - - } else { - resolve(this.liteModMetadata[name] as LiteMod) - return - } - - }) - } - - private processZip(zip: StreamZip, name: string): LiteMod { - - let raw: Buffer | undefined - try { - raw = zip.entryDataSync('litemod.json') - } catch(err) { - // ignored - } - - if (raw) { - this.liteModMetadata[name] = JSON.parse(raw.toString()) as LiteMod - } else { - throw new Error(`Litemod ${name} does not contain litemod.json file.`) - } - - return this.liteModMetadata[name] as LiteMod - - } - -}