Skip to content
This repository was archived by the owner on Apr 12, 2026. It is now read-only.

Commit 0d0c840

Browse files
committed
feat: add Modrinth modpack integration and tests
1 parent 655befd commit 0d0c840

5 files changed

Lines changed: 467 additions & 56 deletions

File tree

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,6 @@ ehthumbs.db
145145
Thumbs.db
146146

147147
testIn
148-
testOut
148+
testOut
149+
150+
*.mrpack

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# server pack builder
22

3-
A Python CLI tool for filtering Minecraft modpacks to create server-compatible mod sets.
3+
A Python CLI tool for filtering Minecraft modpacks to create server-compatible mod sets. It supports both local directory processing and direct Modrinth modpack integration.
44

55
## Installation
66

@@ -12,29 +12,49 @@ pip install -r requirements.txt
1212

1313
## Usage
1414

15-
Run the tool with source and destination directories:
15+
The tool operates in two modes: Local and Modrinth.
16+
17+
### Local Mode
18+
Process a local directory of mods:
1619

1720
```bash
1821
python server_pack_builder.py --source /path/to/mods --destination /path/to/server_mods
1922
```
2023

24+
### Modrinth Mode
25+
Download and filter a Modrinth modpack directly from a URL or slug:
26+
27+
```bash
28+
python server_pack_builder.py --modrinth-url https://modrinth.com/modpack/fabric-boosted
29+
```
30+
2131
### Arguments
22-
- `--source`, `-s`: Path to the source 'mods' directory (required)
23-
- `--destination`, `-d`: Path to the destination 'mods' directory (required)
24-
- `--dry-run`: Simulate the process without copying files (optional)
25-
- `--verbose`, `-v`: Enable verbose logging (optional)
32+
33+
#### Common
34+
- `--dry-run`: Simulate the process without copying or writing files.
35+
- `--verbose`, `-v`: Enable verbose logging.
36+
37+
#### Local Mode
38+
- `--source`, `-s`: Path to the source 'mods' directory.
39+
- `--destination`, `-d`: Path to the destination 'mods' directory.
40+
41+
#### Modrinth Mode
42+
- `--modrinth-url`, `-m`: Modrinth Modpack URL or Slug.
43+
- `--output-file`, `-o`: Output path for the generated `.mrpack` (optional, defaults to `{PackName}-server.mrpack`).
2644

2745
## Features
2846

29-
- Filters out client-only mods
30-
- Supports Fabric and Forge mod loaders
31-
- Preserves server-required mods
47+
- **Client-Side Filtering**: Automatically detects and removes client-only mods by inspecting JAR metadata.
48+
- **Modrinth Integration**: Downloads, filters, and repacks `.mrpack` files.
49+
- **Multi-Loader Support**: Works with Fabric and Forge mod loaders.
50+
- **Overrides Preservation**: Keeps configuration and other data from the modpack's `overrides` folder.
3251

3352
## Development
3453

3554
For linting and testing:
3655

3756
```bash
38-
black . && isort . && flake8 . && mypy .
39-
pytest
57+
python -m black . && python -m isort . && python -m flake8 . && python -m mypy .
58+
python -m pytest
4059
```
60+

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
requests
2+
tomli; python_version < "3.11"

0 commit comments

Comments
 (0)