SciCraft/docs/server.md
MiTHRAL ae0ede6c28
All checks were successful
Build & Release Pack / build (push) Successful in 1m46s
SCICRAFT — The Dark Photon Protocol v1.0.0
NeoForge 1.21.1 (21.1.248) packwiz pack: client + server packs, story
system (KubeJS/FTB Quests), patched World Portal & Create Ore Excavation,
performance presets, and ops tooling. Clean-history import for v1.0.0.
2026-08-24 14:27:31 -04:00

91 lines
No EOL
4.3 KiB
Markdown

# Server — Properties, JVM, Operations
Three server tiers are provided as drop-in presets in `presets/<tier>/server/`
(see `presets/README.md`). The **Medium** tier is the recommended default.
| Tier | Host RAM | view-distance | simulation-distance | max-players |
|------|----------|---------------|---------------------|-------------|
| Low | 8-16 GB | 5 | 4 | 8 |
| **Medium** | 16-32 GB | 8 | 6 | 8 |
| High | 32 GB+ | 12 | 10 | 16 |
Apply a tier (after `packwiz install`):
```bash
cp presets/medium/server/server.properties server_pack/server.properties
# then use the matching jvm-flags.txt when launching
```
`server_pack/eula.txt` → `eula=true` (after review).
## Recommended JVM Flags (server, Medium)
```bash
java -Xms4G -Xmx8G \
-XX:+UseG1GC \
-XX:+ParallelRefProcEnabled \
-XX:MaxGCPauseMillis=200 \
-XX:+UnlockExperimentalVMOptions \
-XX:+DisableExplicitGC \
-XX:+AlwaysPreTouch \
-XX:G1NewSizePercent=30 \
-XX:G1MaxNewSizePercent=40 \
-XX:G1HeapRegionSize=8M \
-XX:G1ReservePercent=20 \
-XX:G1HeapWastePercent=5 \
-XX:G1MixedGCCountTarget=4 \
-XX:InitiatingHeapOccupancyPercent=15 \
-XX:G1MixedGCLiveThresholdPercent=90 \
-XX:G1RSetUpdatingPauseTimePercent=5 \
-Dlog4j2.formatMsgNoLookups=true \
-jar neoforge-21.1.248-server.jar nogui
```
Notes:
- G1 tuning keeps large-tech-server TPS stable under chunk gen (Krypton
Reno + BadOptimizations help server-side).
- `-Xms4G` avoids early GC churn. Cap at 8G for Medium; this pack is
RAM-hungry from AE2/Mekanism tick load but Medium does not need 16G.
- See `presets/low/server/jvm-flags.txt` (2-4G) and
`presets/high/server/jvm-flags.txt` (8-16G) for the other tiers.
## Server start order
1. `packwiz install --dir server_pack` (first time / after changes)
2. Accept EULA.
3. Launch with the JVM flags above.
## Common failures
| Symptom | Fix |
|---------|-----|
| "Mismatched mods" on client join | Run `packwiz refresh` both packs, redeploy. |
| Sinytra connector errors | Update Sinytra Connector + Forgified Fabric API together. |
| Iris black screen | Disable flywheel compat first, then test without shaders. |
| Crash on world gen (Deeper and Darker) | Ensure CF 659011 + its lithostitched data load; update both. |
| TPS lag from many AE2 cells | Check FTB chunk claims; lower `simulation-distance`. |
| Immersive Portals won't load | Must be the Fabric jar added via `url add --force` (Modrinth blocks loader mismatch). |
| Server boots with OLD mod set after a pack update | `packwiz-installer -g` only disables the GUI — it does NOT refresh metadata. Freshness comes from which `pack.toml` it reads: if the panel cloned the repo, `git pull` (or wipe + re-clone) before restart; the start script prefers a **local** `server_pack/pack.toml` over the remote URL. Verify with `python3 tools/validate_pack.py server_pack remote`. |
| `EntityLMixin` / worldportal crash on boot | The pack ships a patched World Portal (`tools/patches/`); make sure `mods/worldportal-neoforge-0.0.10+1.21-patched.jar` is what actually landed (see stale-metadata row above). |
| KubeJS `Wrapper for class ...ProcessingOutput already exists!` | Pack ships a patched Create Ore Excavation (`tools/patches/build_patched_coe.sh`) that removes its duplicate rhino wrapper; upstream race between COE and kubejs-create mod-construction order. Verify the `-patched.jar` landed (see stale-metadata row above). |
### Patched jars in this pack
Two mods ship as locally patched jars under `tools/patches/`; both are
referenced by `mods/*.pw.toml` via raw git URLs, so **the jars must be pushed
for any fresh install to work**:
| Jar | Patch | Reproduce with |
|-----|-------|----------------|
| `worldportal-neoforge-0.0.10+1.21-patched.jar` | Removes `EntityLMixin` (conflicts with Sable mixins) | hand-patched; see commit a88a0c2 |
| `createoreexcavation-1.21-1.6.8-patched.jar` | Strips COE's guarded `ProcessingOutput` wrapper registration (race vs kubejs-create) | `bash tools/patches/build_patched_coe.sh` |
After changing either: update the hash in **both** packs'
`mods/<name>.pw.toml`, run `packwiz refresh`, then
`python3 tools/validate_pack.py <pack> remote`.
## Backups
- World: copy `server_pack/world/` (or use FTB Chunks backups).
- Configs: `server_pack/config/` mirrors client defaults; keep both in sync
when changing KubeJS scripts or FTB settings.