Initial RemotePackSync plugin
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
# RemotePackSync
|
||||
|
||||
RemotePackSync is a lightweight **Spigot 26.2** plugin that keeps a server resource pack synchronized with a remotely hosted SHA-1 checksum. It uses only the public Bukkit/Spigot API, so it runs unchanged on **Spigot, Paper, Purpur, and Bukkit-compatible servers**.
|
||||
|
||||
No NMS, packet libraries, or fork-specific APIs are used.
|
||||
|
||||
## Requirements
|
||||
|
||||
- Java 25 (Minecraft/Spigot 26.2 requires Java 25)
|
||||
- A Minecraft/Spigot 26.2-compatible server
|
||||
|
||||
## Build
|
||||
|
||||
```bash
|
||||
mvn clean package
|
||||
```
|
||||
|
||||
The ready-to-install plugin is written to:
|
||||
|
||||
```text
|
||||
target/RemotePackSync.jar
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
1. Copy `RemotePackSync.jar` into the server's `plugins/` directory.
|
||||
2. Start the server once. RemotePackSync writes `plugins/RemotePackSync/config.yml` automatically.
|
||||
3. Configure the resource-pack and SHA-1 URLs.
|
||||
4. Restart the server, or run `/remotepacksync reload` as an operator.
|
||||
|
||||
## Configuration
|
||||
|
||||
```yaml
|
||||
# Direct URL to the .zip resource pack. Leave blank to disable pack delivery.
|
||||
resourcePackUrl: "https://cdn.example.com/server-pack.zip"
|
||||
|
||||
# URL to a text file containing the pack's SHA-1 checksum.
|
||||
sha1Url: "https://cdn.example.com/server-pack.zip.sha1"
|
||||
|
||||
# Seconds between SHA-1 checks. Minimum: 30.
|
||||
refreshInterval: 300
|
||||
```
|
||||
|
||||
The SHA-1 response must contain a 40-character hexadecimal SHA-1. Both of these standard formats work:
|
||||
|
||||
```text
|
||||
0123456789abcdef0123456789abcdef01234567
|
||||
```
|
||||
|
||||
```text
|
||||
0123456789abcdef0123456789abcdef01234567 server-pack.zip
|
||||
```
|
||||
|
||||
## Behaviour
|
||||
|
||||
- On startup and at every refresh interval, RemotePackSync fetches only the SHA-1 file asynchronously.
|
||||
- When the SHA-1 changes, it sends the configured resource-pack URL and new hash to every online player.
|
||||
- Players joining after a successful SHA-1 fetch receive the current resource pack.
|
||||
- A failed request leaves the last known-good SHA-1 active, so a brief CDN outage does not interrupt existing pack delivery.
|
||||
- If both URLs are blank, delivery is disabled without error. If only one is set, the configuration is rejected and delivery remains disabled.
|
||||
|
||||
## Commands and permissions
|
||||
|
||||
- `/remotepacksync reload` (alias: `/rps reload`) reloads `config.yml` and begins a fresh asynchronous SHA-1 refresh.
|
||||
- Permission: `remotepacksync.reload` (default: `op`).
|
||||
|
||||
## Compatibility
|
||||
|
||||
RemotePackSync compiles against `org.spigotmc:spigot-api:26.2-R0.1-SNAPSHOT` and targets Java 25, which is required by Minecraft/Spigot 26.2. Resource packs are sent through Bukkit's stable `Player#setResourcePack(String, byte[])` API.
|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
Reference in New Issue
Block a user