Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ hs_err_pid*
config/
build/
input/
output/
/output/
modlist.html
modlist.md
manifest.json
*.mrpack
131 changes: 41 additions & 90 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,134 +2,85 @@

[![Total downloads](https://img.shields.io/github/downloads/ModdingX/ModListCreator/total.svg)](https://www.github.com/ModdingX/ModListCreator/releases/)

## How to use

1. Put the ModListCreator file into a folder
2. Extract the `manifest.json` file from an exported modpack file into the same folder
3. Run ModListCreator jar file
4. Wait for all the `output/modlist.*` files

## Arguments you could use

Argument | Output
----------------- | --------------------------------------------------
`help` | Shows descriptions to all arguments
`md` / `markdown` | Exports **Markdown** files
`html` | Exports **HTML** files
`detailed` | Shows exact version of each mod
`headless` | Generates the file without pack name/version
`nameFormat` | Defines the name format
`manifest` | Defines manifest file
`input` | Defines the input directory for multiple manifests/exported zips
`output` | Defines the output directory for generated files
`workingDir` | Defines the path where input and output should be

You can combine multiple arguments in one command. You can see the usage below.

### MD / Markdown / HTML

To use this argument, use the following command:
## How to get

`$ java -jar ModListCreator-<version>.jar --md`
1. [Download here](https://github.com/ModdingX/ModListCreator/releases)

OR

`$ java -jar ModListCreator-<version>.jar --markdown`
1. Clone this repository
2. Run `gradlew build`
3. Get file from path/build/libs/

OR
## How to use - Modlist

1. Put the ModListCreator file into a folder
2. Open terminal/cmd
3. Add `modlist` after `java -jar ModListCreator-<version>-fatjar.jar`
4. Set arguments listed below
5. After all arguments, set the input files (`folder/*` for whole folder)
6. Run it and wait for output file(s)

`$ java -jar ModListCreator-<version>.jar --html`
## Arguments you could use

This will generate only the given file type. Otherwise it will generate all types.
| Argument | Output |
|------------|---------------------------------------------------------------------------------------------------------------------------------|
| no-header | Generates the file without pack name and version |
| detailed | Shows exact version of each mod |
| format | The output format to use (`txt`, `html`, or `md` (default)) |
| **output** | Defines the output path for generated files. If --pattern is set, describes a directory for output files, else a concrete file. |
| pattern | Defines the output file name pattern. %n is replaced with pack name, %v with pack version. |

## Examples
### Detailed

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --detailed`
`$ java -jar ModListCreator-<version>-fatjar.jar --detailed`

Without argument | With argument
------------------------------- | ----------------------------------------
AIOT Botania (by MelanX) | aiotbotania-1.16.2-1.3.2.jar (by MelanX)
Automatic Tool Swap (by MelanX) | ToolSwap-1.16.2-1.2.0.jar (by MelanX)
Botania (by Vazkii) | Botania-1.16.3-409.jar (by Vazkii)
| Without argument | With argument |
|---------------------------------|------------------------------------------|
| AIOT Botania (by MelanX) | aiotbotania-1.16.2-1.3.2.jar (by MelanX) |
| Automatic Tool Swap (by MelanX) | ToolSwap-1.16.2-1.2.0.jar (by MelanX) |
| Botania (by Vazkii) | Botania-1.16.3-409.jar (by Vazkii) |

### Headless
### No Header

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --headless`
`$ java -jar ModListCreator-<version>-fatjar.jar --no-header`

Without argument | With argument
------------------------------------------- | -------------
Garden of Glass (Questbook Edition) - 4.2.0 | _nothing_
| Without argument | With argument |
|---------------------------------------------|---------------|
| Garden of Glass (Questbook Edition) - 4.2.0 | _nothing_ |

### NameFormat
### Pattern

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --nameFormat DEFAULT`

Allowed values:
`$ java -jar ModListCreator-<version>-fatjar.jar --pattern "This is %n in version %v`

Format type | Output
------------ | ----------------------------------------------
DEFAULT | modlist.md
VERSION | 4.2.0.md
NAME | Garden of Glass (Questbook Edition).md
NAME_VERSION | Garden of Glass (Questbook Edition) - 4.2.0.md

If you generate .html files, the extension will be `.html`.
> This is CaveStone in version 0.4.0

### Input

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --input examplePath`

If you don't set the input, it will just use the [manifest.json](#manifest).
`$ java -jar ModListCreator-<version>-fatjar.jar --pattern "Name" --output output modpacks/*`

Otherwise, this will try to get each file in `examplePath` and creates a modlist in the [output](#output).
This will use the folder `modpacks` as input and tries to generate a modlist for each file in this folder.

### Output

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --output examplePath`
`$ java -jar ModListCreator-<version>-fatjar.jar --output output.md`

If you don't set the output, it will just use the `output` folder in the [base directory](#workingDir).

Otherwise, this will try to generate all the modlist files into `examplePath`. If the folder doesn't exist, it will be generated.

### Manifest

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --manifest example.json`

You can also define an exported zip containing a `manifest.json`.
If you don't set the manifest, it will just use the `manifest.json` in the [base directory](#workingDir).

### WorkingDir

To use this argument, use the following command:

`$ java -jar ModListCreator-<version>.jar --workingDir D:\path\to\directory`

If you don't set this, it will use the location of you Jar as base directory.
This will generate a file called `output.md`. If you set `--pattern` argument, it will generate a folder
called `output.md`.

## Why use this instead of exported modlist?

- This tool sorts the project names alphabetically
- This tool links to the project and the author
- The official `modlist.html` contains broken links to the projects

## How to get

1. [Download here](https://github.com/ModdingX/ModListCreator/releases)

OR

1. Clone this repository
2. Run `gradlew build`
3. Get file from path/build/libs/
8 changes: 3 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,16 @@ repositories {
}

dependencies {
implementation "org.moddingx:CurseWrapper:2.1"
implementation "org.moddingx:CurseWrapper:3.0"

implementation 'com.atlassian.commonmark:commonmark:0.17.0'
implementation 'org.jsoup:jsoup:1.15.2'
implementation "net.sf.jopt-simple:jopt-simple:6.0-alpha-3"
}

java.toolchain.languageVersion = JavaLanguageVersion.of(17)

jar {
manifest {
attributes([
"Main-Class": "org.moddingx.modlistcreator.ModListCreator"
"Main-Class": "org.moddingx.modlistcreator.Main"
])
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=3.0.1
version=4.0.0
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
10 changes: 5 additions & 5 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

#
# Copyright 2015-2021 the original authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,10 +32,10 @@
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions $var�, �${var}�, �${var:-default}�, �${var+SET},
# ${var#prefix}�, �${var%suffix}, and $( cmd );
# * compound commands having a testable exit status, especially case;
# * various built-in commands including command�, �set, and ulimit.
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
Expand Down
24 changes: 24 additions & 0 deletions src/main/java/org/moddingx/modlistcreator/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.moddingx.modlistcreator;

import org.moddingx.modlistcreator.modlist.ModListCreator;

import java.io.IOException;
import java.util.Locale;

public class Main {

public static void main(String[] args) throws IOException {
String cmd = args.length == 0 ? "" : args[0];
String[] newArgs = new String[Math.max(0, args.length - 1)];
if (newArgs.length > 0) {
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
}
switch (cmd.toLowerCase(Locale.ROOT)) {
case "modlist" -> ModListCreator.run(newArgs);
default -> {
System.err.println("ModListCreator - Choose sub-command\n");
System.err.println(" modlist: Create a modlist file from a CurseForge or Modrinth modpack.");
}
}
}
}
Loading