|
| 1 | +# BlockyServer |
| 2 | + |
| 3 | +> [!WARNING] |
| 4 | +> Not affiliated with Hypixel Studios. |
| 5 | +> All trademarks and assets are property of their respective owners. |
| 6 | +
|
| 7 | +HTTP API for rendering Hytale character models as GLB, PNG, or animated GIF. |
| 8 | + |
| 9 | +Built on top of [blockymodel-merger](https://github.com/hytale-tools/blockymodel-merger) by [JackGamesFTW](https://github.com/JackGamesFTW), special thanks to him! |
| 10 | + |
| 11 | +## Features |
| 12 | + |
| 13 | +- Merge character accessories into a single model |
| 14 | +- Export as GLB (glTF binary) |
| 15 | +- Render to PNG with configurable rotation and background |
| 16 | +- Render to animated rotating GIF |
| 17 | +- Swagger UI documentation |
| 18 | + |
| 19 | +## Requirements |
| 20 | + |
| 21 | +- Go 1.21+ |
| 22 | +- `assets/` directory with character models and textures |
| 23 | +- `data/` directory with JSON registry files |
| 24 | + |
| 25 | +## Obtaining Assets |
| 26 | + |
| 27 | +> [!NOTE] |
| 28 | +> You must purchase [Hytale](https://store.hytale.com) to obtain assets. Use code `jack` in the Hytale Store to support Jack's projects. |
| 29 | +
|
| 30 | +Download `assets.zip` from the [Hytale Server Manual](https://support.hytale.com/hc/en-us/articles/45326769420827-Hytale-Server-Manual#server-setup). |
| 31 | + |
| 32 | +**Important:** Use the server version, not the client version. The server package includes the `data/` directory with registry JSON files. |
| 33 | + |
| 34 | +### Using extract-assets tool |
| 35 | + |
| 36 | +Clone and build the extraction tool from blockymodel-merger: |
| 37 | + |
| 38 | +```bash |
| 39 | +git clone https://github.com/hytale-tools/blockymodel-merger.git |
| 40 | +cd blockymodel-merger |
| 41 | +go build -o extract-assets ./cmd/extract-assets |
| 42 | +./extract-assets /path/to/assets.zip |
| 43 | +``` |
| 44 | + |
| 45 | +This extracts files into the required structure: |
| 46 | +- `Common/Characters` → `assets/Characters/` |
| 47 | +- `Common/Cosmetics` → `assets/Cosmetics/` |
| 48 | +- `Common/TintGradients` → `assets/TintGradients/` |
| 49 | +- `Cosmetics/CharacterCreator` → `data/` |
| 50 | + |
| 51 | +Copy the resulting `assets/` and `data/` directories to your blockyserver folder. |
| 52 | + |
| 53 | +## Installation |
| 54 | + |
| 55 | +```bash |
| 56 | +git clone https://github.com/yourusername/blockyserver.git |
| 57 | +cd blockyserver |
| 58 | +go mod tidy |
| 59 | +go build -o blockyserver.exe . |
| 60 | +``` |
| 61 | + |
| 62 | +## Usage |
| 63 | + |
| 64 | +```bash |
| 65 | +# Start server on default port 8080 |
| 66 | +./blockyserver.exe |
| 67 | + |
| 68 | +# Start on custom port |
| 69 | +./blockyserver.exe -port 3000 |
| 70 | +``` |
| 71 | + |
| 72 | +## Docker |
| 73 | + |
| 74 | +### Using Docker Compose (recommended) |
| 75 | + |
| 76 | +```bash |
| 77 | +docker compose up -d |
| 78 | +``` |
| 79 | + |
| 80 | +This mounts `assets/` and `data/` directories as read-only volumes. |
| 81 | + |
| 82 | +### Using Docker directly |
| 83 | + |
| 84 | +```bash |
| 85 | +# Build image |
| 86 | +docker build -t blockyserver . |
| 87 | + |
| 88 | +# Run container |
| 89 | +docker run -d -p 8080:8080 \ |
| 90 | + -v $(pwd)/assets:/app/assets:ro \ |
| 91 | + -v $(pwd)/data:/app/data:ro \ |
| 92 | + blockyserver |
| 93 | +``` |
| 94 | + |
| 95 | +## API Endpoints |
| 96 | + |
| 97 | +| Endpoint | Method | Description | |
| 98 | +|----------|--------|-------------| |
| 99 | +| `/render/glb` | POST | Returns GLB binary | |
| 100 | +| `/render/png` | POST | Returns PNG image | |
| 101 | +| `/render/gif` | POST | Returns animated GIF | |
| 102 | +| `/docs` | GET | Swagger UI | |
| 103 | +| `/openapi.json` | GET | OpenAPI specification | |
| 104 | +| `/health` | GET | Health check | |
| 105 | + |
| 106 | +## Example Request |
| 107 | + |
| 108 | +### Render PNG |
| 109 | + |
| 110 | +```bash |
| 111 | +curl -X POST http://localhost:8080/render/png \ |
| 112 | + -H "Content-Type: application/json" \ |
| 113 | + -d '{ |
| 114 | + "character": { |
| 115 | + "bodyCharacteristic": "Default.02", |
| 116 | + "haircut": "Scavenger_Hair.PitchBlack", |
| 117 | + "eyes": "Large_Eyes.Pink", |
| 118 | + "pants": "Pants_A.Blue", |
| 119 | + "undertop": "Shirt_A.White" |
| 120 | + }, |
| 121 | + "rotation": 45, |
| 122 | + "background": "transparent", |
| 123 | + "width": 512, |
| 124 | + "height": 512 |
| 125 | + }' --output character.png |
| 126 | +``` |
0 commit comments