> For the complete documentation index, see [llms.txt](https://donkolia.gitbook.io/minesantum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://donkolia.gitbook.io/minesantum/santumpacksloader.md).

# SantumPacksLoader

{% embed url="<https://youtu.be/VFbNCCpIpjs>" %}

This plugin eliminates the headache of manually merging multiple resource packs (e.g., combining ModelEngine models with your server's custom textures). It handles merging, metadata preservation, and HTTP hosting automatically

## ✨ Features

* **Built-in HTTP Server**: No need for external web servers (Apache/Nginx) or Dropbox links. The plugin hosts the resource pack directly from your Minecraft server using a lightweight HTTP daemon
* **Smart On-the-fly Merging**: Automatically combines multiple `.zip` resource packs into a single seamless `merged.zip` during server startup
* **Priority System**: Resolves file conflicts based on a priority queue. A pack with priority `1` will overwrite conflicting files from a pack with priority `2`
* **1.21+ Compatibility & Metadata Preservation**: Intelligently parses and merges `pack.mcmeta` using Google Gson. It preserves crucial modern features like `overlays` (for 1.21.x shaders) and `sodium` configuration, preventing client-side crashes and disconnects
* **Custom Branding**: Automatically injects your custom server thumbnail (`pack.png`), name, and colored description into the final resource pack
* **Automatic Delivery**: Sends the newly merged and hashed resource pack to players smoothly, with built-in delays to avoid login lag spikes

## ⚙️ Configuration (`config.yml`)

The plugin is highly configurable through the `config.yml` file generated in the `plugins/SantumPacksLoader` folder.

```yaml
host:
  address: "localhost" # The IP/Domain where players will download the pack from. Change to your server's public IP.
  port: 8443           # The port used by the built-in HTTP server. Ensure this port is open in your firewall!
  timeout: 15000       # Maximum download timeout in milliseconds

pack_merge:
  name: "&bMineSantum"                           # The name displayed on the resource pack prompt. Supports color codes.
  description: "&6Compatible con código de color" # The description shown in the resource pack menu
  photo_png_64x64: "miniatura.png"               # The thumbnail file to use

packs:
  modelengine:                             # Internal identifier for the pack
    priority: 1                            # Priority level (1 is highest). Files from priority 1 override files from priority 2
    enabled: true                          # Whether this pack should be included in the merge
    path: "ModelEngine/resource pack.zip"  # Relative path to the ZIP file from the main 'plugins/' directory
  wynncraft:
    priority: 2
    enabled: true
    path: "packs/wynncraft.zip"
```

### Explanation of Settings

#### `host` Section

* **`address`**: This is the public IP or domain name of your server. When a player joins, the server tells their client to download the pack from `http://<address>:<port>/pack.zip`. If running locally, `localhost` works. For a public server, set this to your numeric IP or domain (e.g., `play.myserver.com`).
* **`port`**: The port number the built-in web server listens on. You **must port-forward** this number in your router and firewall (TCP).
* **`timeout`**: Connection timeout limit for the HTTP server in milliseconds.

#### `pack_merge` Section

* **`name`**: The title presented to the user on the resource pack download screen. Supports Bukkit color codes (`&b`, `&l`, etc.).
* **`description`**: The description injected into the final merged `pack.mcmeta`. It will be visible if the player looks at their resource pack menu.
* **`photo_png_64x64`**: The exact filename of your custom `pack.png` image. You must place this image inside the `plugins/SantumPacksLoader/pack_merge_photo/` folder. It will serve as the icon for your merged pack.

#### `packs` Section

Define as many packs as you need here. The identifier (e.g., `modelengine`, `wynncraft`) is just for you to organize them.

* **`priority`**: Determines which pack's files are kept if two packs contain the exact same file. Lower numbers mean **higher** priority (Priority 1 overwrites Priority 2).
* **`enabled`**: Set to `false` to temporarily exclude a pack from the merge without deleting its config entry.
* **`path`**: The location of the source zip file. This path is **relative to the root `plugins/` folder**, not the `SantumPacksLoader` folder.

## 💻 Commands & Permissions

All commands require the `santumpacks.admin` permission.

| Command                            | Description                                                                                                                                                                                     |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/santumpacksloader reload`        | Reloads the configuration, stops the current HTTP server, recalculates the merge, hashes the new zip, and restarts the web server. Use this after changing the config or updating a source ZIP. |
| `/santumpacksloader load <player>` | Forces the server to send the currently loaded resource pack to a specific online player.                                                                                                       |
| `/santumpacksloader loadallusers`  | Forces the server to send the resource pack to all currently online players.                                                                                                                    |

## 🛠️ Installation & Setup

1. Drop `SantumPacksLoader-1.0-SNAPSHOT.jar` into your `plugins` folder.
2. Start the server once to generate the default configuration files.
3. Place your custom `pack.png` (64x64 pixels) inside `plugins/SantumPacksLoader/pack_merge_photo/` and name it exactly as specified in `config.yml` (default: `miniatura.png`).
4. Edit `config.yml` to set your public `address`, `port`, and define the paths to your resource packs.
5. Run `/santumpacksloader reload` from the console or in-game to apply the changes and generate the final `merged.zip` cache.

{% hint style="warning" %}

## ⚠️ Important Note for 1.21+ Servers

SantumPacksLoader's JSON engine explicitly merges `overlays` configurations from source packs. If your source packs contain modern shaders or format overlays (like Iris/Sodium outlines), they will be perfectly preserved to ensure no client-side crashes occur during the download phase
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://donkolia.gitbook.io/minesantum/santumpacksloader.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
