This document explains the structure and organization of the Minecraft Modpack Manager codebase.
modpack_manager/
├── client_packs/ # Generated client-side modpacks (zip files)
├── modpack_cache/ # Downloaded mod files organized by MC version and loader
│ ├── 1.20.1/
│ │ ├── fabric/
│ │ └── forge/
│ └── ...
├── modpack_profiles/ # JSON profile configurations
├── scripts/ # Main executable scripts
│ ├── modpack_manager.sh # Primary management script
│ ├── docker_image_manager.sh # Docker image creation and management
│ └── lib/ # Supporting Python and shell scripts
│ ├── api/ # API interaction modules
│ │ ├── modrinth.py # Modrinth API client
│ │ └── curseforge.py # CurseForge API client
│ ├── core/ # Core functionality
│ │ ├── dependency_resolver.py # Handles mod dependencies
│ │ ├── downloader.py # Downloads mods from APIs
│ │ ├── profile_manager.py # Manages modpack profiles
│ │ └── compatibility_checker.py # Checks version compatibilities
│ └── utils/ # Utility functions
│ ├── config.py # Configuration handling
│ ├── logger.py # Logging utilities
│ └── file_utils.py # File operations
└── backups/ # Server world backups
-
modpack_manager.sh
- Main entry point for user commands
- Parses command-line arguments
- Dispatches to appropriate Python modules
- Provides user-friendly CLI interface
-
docker_image_manager.sh
- Handles Docker image creation and management
- Builds Docker images with specified mods
- Manages containers for testing and deployment
- Analyzes server logs for compatibility issues
-
modrinth.py
- Interfaces with Modrinth API
- Searches for mods
- Retrieves mod details and versions
- Gets download URLs
-
curseforge.py
- Interfaces with CurseForge API
- Searches for mods
- Retrieves mod details and versions
- Gets download URLs
-
dependency_resolver.py
- Analyzes mod dependencies
- Builds dependency graph
- Resolves dependency conflicts
- Determines required dependencies
-
downloader.py
- Downloads mods from APIs
- Manages download cache
- Verifies downloaded files
- Handles download errors and retries
-
profile_manager.py
- Creates and manages modpack profiles
- Reads and writes profile JSON files
- Validates profile contents
- Tracks dependencies
-
compatibility_checker.py
- Determines compatible Minecraft versions
- Checks mod compatibility with loaders
- Analyzes server logs for errors
- Suggests compatible version combinations
-
config.py
- Manages global configuration
- Loads environment variables
- Sets up API keys and credentials
- Configures paths and defaults
-
logger.py
- Handles logging across the application
- Configures log levels and formats
- Writes logs to files
- Provides debug information
-
file_utils.py
- Handles file operations
- Creates and extracts ZIP archives
- Manages cache directories
- Handles file permissions
{
"name": "profile_name",
"minecraft_version": "1.20.1",
"loader": "fabric",
"loader_version": "0.14.21",
"description": "A description of the modpack",
"mods": [
{
"name": "Mod Name",
"id": "mod-id",
"version": "1.2.3",
"source": "modrinth|curseforge",
"required": true
}
],
"dependencies": [
{
"name": "Dependency Name",
"id": "dependency-id",
"version": "1.2.3",
"source": "modrinth|curseforge",
"required_by": ["mod-id"]
}
]
}version: '3'
services:
minecraft:
image: minecraft_profile_name
container_name: minecraft_profile_name
environment:
TYPE: "FABRIC|FORGE"
VERSION: "1.20.1"
EULA: "TRUE"
FABRIC_VERSION: "0.14.21"
MEMORY: "4G"
ports:
- "25565:25565"
volumes:
- ./data:/data
restart: unless-stopped- User invokes
modpack_manager.shwith commands - Shell script parses arguments and calls Python modules
- Python modules interact with APIs, file system, and Docker
- Results are returned to shell script
- Shell script presents information to user