ChunkGenerator
Adaptive, TPS-aware chunk pre-generator for Paper, Purpur and Folia. Auto-tuned to your CPU and heap. Pause, resume and survive restarts.
- Загрузки
- 47
- Подписчики
- 0
- Обновлён
- 14 мая 2026 г.
- Лицензия
- MIT
Опубликован 14 мая 2026 г.
ChunkGenerator is a focused pre-generation plugin for Paper, Purpur and Folia. It generates world chunks in a chosen shape around any center point, adapts to your server's actual TPS in real time, and keeps the BossBar honest about progress, speed and ETA — without crashing the server when the chunk system saturates.
Why ChunkGenerator
- Adaptive, not reckless. A TPS-aware controller scales the inflight chunk pipeline up while your TPS holds and down the moment it slips. No fixed chunks-per-tick budget to misconfigure.
- Auto-tunes to your host. Start it with all defaults: the
plugin reads
availableProcessors()andmaxMemory()at boot and picks a safe pipeline depth for your CPU and JVM heap. The resolved values are logged at startup along with the Paper tuning recommendation for your core count. - OOM-safe. A memory-pressure circuit breaker scales the
pipeline down past a configurable heap threshold and pauses new
submissions entirely past the next, resuming automatically once
the GC catches up. Specifically designed to survive container
hosts (Pterodactyl, Docker) with aggressive
MaxRAMPercentage. - Survives restarts. Per-world progress is persisted atomically to YAML and resumed automatically when the server comes back up.
Features
- Pre-generation jobs over square, circle or rectangle zones with an optional explicit center (defaults to world spawn).
- One job per world; multiple worlds generate in parallel.
- Live BossBar for staff (
chunkgenerator.bossbar), compact ActionBar for the player who launched the job, and a periodic console progress line withinflight/target,chunk/s,TPS,CPUandRAMreadings. /cg statussnapshots with progress percent, speed, ETA, server TPS, process CPU and JVM RAM usage.- Pause / resume / cancel mid-flight with state preserved across restarts.
- Paper, Purpur and Folia all supported. Folia is handled through a reflection-based scheduler bridge so the plugin keeps a pure Paper-API compile classpath.
- LuckPerms integration with
/opfallback when LuckPerms is absent.
Commands
| Command | What it does |
|---|---|
/cg start <world> <shape> <size> [centerX centerZ] |
Start a job (shape = square / circle / rectangle). |
/cg stop <world> |
Pause a running job (state preserved). |
/cg resume <world> |
Resume a paused job. |
/cg cancel <world> |
Cancel and discard a job's state. |
/cg status [world] |
Live snapshot of progress, perf and pipeline. |
/cg list |
List all known jobs. |
/cg reload |
Reload config.yml and messages.yml. |
Alias: /chunkgen.
Configuration
config.yml is split into a short Basics block
(target-tps, bossbar / actionbar / console toggles, auto-resume)
and an Advanced throttle section that most servers never need
to touch. All player-facing strings live in messages.yml with the
standard & color codes.
Maximising throughput
The plugin keeps Paper's chunk request queue saturated, but the real
ceiling is Paper's chunk worker count, not the plugin's queue
depth. Open config/paper-global.yml and raise:
chunk-system:
worker-threads: <cores - 1> # e.g. 5 on a 6-core host
io-threads: 3
The default -1 is "auto", which usually allocates only around
cores / 2 workers — perfectly safe for a populated survival
server, but leaves most of the CPU idle during pre-generation. The
plugin prints the recommended values for your host in the startup
log.
Ченджлог
0.1.0-beta.1Бета26.1.2 · 14 мая 2026 г.
First beta release after a round of production tuning on real hosts. The plugin now ships with auto-scaled throttle defaults calibrated against an actual container-host crash, six chunk-visit patterns, a resume command, and a simplified config aimed at public use.
Added
- Traversal patterns as an optional last argument to
/cg start. Six patterns:center(default, spiral outward from the zone center),edge(concentric rings inward from the outer perimeter to the center), andnorth/south/east/west(linear row or column sweep starting at the named edge). All patterns visit the same set of chunks; only the order differs, and the saved iterator index is pattern-aware so a paused job resumes in its own sequence. /cg resume <world>to restart a paused job from where it left off, completing the start / stop / resume / cancel quartet. Paused jobs were previously only reactivated by a server restart withauto-resume: true. New permission nodechunkgenerator.command.resume.inflight/targetpipeline pressure reading in/cg statusand the periodic console log. When chunks are being submitted but not completing (slow Paper chunk worker, stuck futures, far-out generation) the diagnosis is obvious from one command.- Startup log lines that report the resolved throttle values and
recommend a
paper-global.yml > chunk-system > worker-threadssetting matching the host's core count, so operators do not have to derive the Paper-side tuning themselves. - README sections on container hosts and
MaxRAMPercentage(Pterodactyl, Docker — heap-based monitoring cannot observe the cgroup RSS ceiling) and on maximising sustained throughput (the real ceiling is Paper's chunk worker count, not the plugin's queue depth).
Changed
config.ymlflattened and trimmed for public use. A short Basics block at the top (target-tps, bossbar / actionbar / console toggles,auto-resume) and an Advancedthrottlesection that most servers never need to touch. A banner at the very top points operators atpaper-global.yml > chunk-systemfor the actual speed lever. Thedisplay,monitoringandpersistencewrapper sections are gone — every knob lives at the root now.- Auto-scaled defaults retuned against production data and tied to
the core count rather than the heap alone, with a conservative
30 MB-per-inflight-chunk transient estimate.
max-inflight = max(64, min(cores × 32, heapMB / 60))start-inflight = max(16, cores × 6)
- Default memory thresholds lowered:
memory-backoff-pct85 → 70,memory-pause-pct92 → 80, to keep a margin from the container RSS limit that heap-based monitoring cannot see directly.
Fixed
- Kernel-OOM crash on container hosts (Pterodactyl, exit code
- when the throttle saturated to its previous auto-scaled ceiling and Paper's chunk save thread fell behind: held chunks plus native memory exceeded the cgroup limit even while JVM heap stayed under the old 85 % backoff threshold.
- ETA no longer overflows to
Long.MAX_VALUE(rendered as2562047788015215h30m) when the smoothed speed decays toward zero. Below 0.01 chunk/s or for predicted ETAs over a year, the status returns?instead of a meaningless number. - Speed readout shows two decimals below 10 chunk/s and one decimal
below 100, so sub-1 chunk/s progress no longer rounds to a flat
0.
Migration
- Delete
plugins/ChunkGenerator/config.ymlafter upgrading so the new flat layout (with thepaper-global.ymltuning banner) regenerates. Old YAMLs still load but stay on the previous keys that the plugin no longer reads.
0.1.0-alpha.2Альфа26.1.2 · 14 мая 2026 г.
- Memory pressure circuit breaker: the throttle scales down once
heap usage crosses
memory-backoff-pctof max heap and pauses new chunk submissions entirely pastmemory-pause-pct, resuming automatically once pressure clears. - Auto-scaled defaults: the inflight ceiling and start target now
derive from
availableProcessors()andmaxMemory()at startup, so the plugin saturates Paper's chunk pipeline on any host without manual tuning.
Changed
- New throttle model: the controller now targets a count of
concurrent chunk requests in flight instead of a fixed
chunks-per-tick budget. This matches Paper's asynchronous chunk
system and removes the budget-loss bug that capped throughput
every time the previous hardcoded
MAX_INFLIGHT = 200ceiling was reached. - Speed readout labelled
chunk/sinstead ofc/severywhere (BossBar, ActionBar, console log,/cg status,/cg list).
Removed
- Config keys
throttle.max-chunks-per-tickandthrottle.min-chunks-per-tick(replaced bythrottle.max-inflight,throttle.min-inflightandthrottle.start-inflight), and the hardcodedMAX_INFLIGHT = 200ceiling on concurrent chunk loads.
Migration
Existing config.yml files keep working — the new keys fall back to
sensible auto-scaled values. To pick them up explicitly, delete
plugins/ChunkGenerator/config.yml and the plugin will write a
fresh one on the next start.
0.1.0-alpha.1Альфа26.1.2 · 14 мая 2026 г.
Initial alpha release. Functional and self-contained, kept on the alpha channel until shape iteration, throttle behaviour and resume logic have been validated on production-scale worlds.
Features
- Pre-generation jobs over square, circle and rectangle zones with an optional explicit center (default: world spawn).
- TPS-aware auto-throttle that adapts chunks-per-tick to hold the configured target TPS.
- One job per world; jobs across worlds run in parallel.
- Live BossBar for staff (
chunkgenerator.bossbar), ActionBar for the launching player, periodic console progress logs and/cg statussnapshots — all with generation speed, TPS, process CPU and JVM RAM readings. - Atomic per-world YAML persistence in
plugins/ChunkGenerator/jobs/with automatic resume after a server restart. - Paper, Purpur and Folia support via a reflection-based scheduler bridge — no Folia API on the compile classpath required.
- LuckPerms integration with
/opfallback when LuckPerms is absent.
Commands
/cg start <world> <shape> <size> [centerX centerZ]/cg stop <world>— pause (state preserved on disk)/cg cancel <world>— cancel and delete state file/cg status [world]— snapshot of progress, speed, ETA, perf/cg list— list all known jobs/cg reload— reloadconfig.ymlandmessages.yml/cg help
Alias: /chunkgen.
Комментарии
Загружаем…