ChunkGenerator
PluginMIT

ChunkGenerator

Adaptive, TPS-aware chunk pre-generator for Paper, Purpur and Folia. Auto-tuned to your CPU and heap. Pause, resume and survive restarts.

44
Downloads
0
Followers
1 months ago
Updated
📦
3
Versions

📖About ChunkGenerator

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() and maxMemory() 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 with inflight/target, chunk/s,
    TPS, CPU and RAM readings.
  • /cg status snapshots 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 /op fallback 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.