ChunkGenerator 是一款专为 Paper、Purpur 和 Folia 打造的聚焦式预生成插件。它能在以任意中心点为圆心的选定形状区域内生成世界区块,实时适配服务器的实际 TPS,并通过 BossBar 准确显示进度、速度和预计完成时间(ETA)——即使在区块系统饱和时也不会导致服务器崩溃。
为何选择 ChunkGenerator
- 自适应而非鲁莽。具备 TPS 感知能力的控制器会在你的 TPS 稳定时提升在途区块流水线负载,而在 TPS 下降的瞬间立即降低负载。无需手动配置固定的“每刻生成区块数”配额。
- 自动适配你的主机环境。使用所有默认值启动即可:插件在启动时会读取
availableProcessors() 和 maxMemory(),并为你当前的 CPU 和 JVM 堆内存选择一个安全的流水线深度。解析出的数值会随同针对你核心数的 Paper 调优建议一起记录在启动日志中。
- 防止 OOM(内存溢出)。内存压力熔断器会在达到可配置的堆阈值时自动缩小流水线规模,并在超过下一阈值时完全暂停新的提交任务,待 GC(垃圾回收)跟上后自动恢复。该设计专门用于在具有激进
MaxRAMPercentage 设置的容器化主机(如 Pterodactyl、Docker)上生存。
- 支持重启后恢复。每个世界的进度会以原子方式持久化到 YAML 文件中,并在服务器重新上线时自动恢复。
功能特性
- 支持对 正方形、圆形 或 矩形 区域进行预生成作业,并可指定显式中心点(默认为世界出生点)。
- 每个世界一个作业;多个世界可同时并行生成。
- 工作人员可通过 BossBar 查看状态(权限
chunkgenerator.bossbar),发起作业的玩家可通过紧凑的 ActionBar 查看信息,控制台也会定期输出包含 inflight/target(在途/目标)、chunk/s(每秒区块数)、TPS、CPU 和 RAM 读数的进度行。
/cg status 命令可提供快照,显示进度百分比、速度、ETA、服务器 TPS、进程 CPU 使用率和 JVM 内存使用情况。
- 支持中途暂停 / 恢复 / 取消,且状态在重启后得以保留。
- 全面支持 Paper、Purpur 和 Folia。对于 Folia,插件通过基于反射的调度器桥接进行处理,从而保持纯 Paper-API 编译类路径。
- 集成 LuckPerms,当未安装 LuckPerms 时回退至
/op 权限检查。
命令
| 命令 |
功能说明 |
/cg start <world> <shape> <size> [centerX centerZ] |
开始作业(shape = square / circle / rectangle)。 |
/cg stop <world> |
暂停正在进行的作业(状态已保存)。 |
/cg resume <world> |
恢复已暂停的作业。 |
/cg cancel <world> |
取消作业并丢弃其状态。 |
/cg status [world] |
获取进度、性能及流水线的实时快照。 |
/cg list |
列出所有已知作业。 |
/cg reload |
重载 config.yml 和 messages.yml。 |
别名:/chunkgen。
配置
config.yml 分为简短的 Basics(基础)模块(包括 target-tps、bossbar/actionbar/console 开关、auto-resume)以及大多数服务器无需触碰的 Advanced(高级)throttle(节流)部分。所有面向玩家的字符串均位于 messages.yml 中,并使用标准的 & 颜色代码。
最大化吞吐量
插件会保持 Paper 的区块请求队列处于饱和状态,但真正的上限是 Paper 的区块工作线程数,而非插件自身的队列深度。请打开 config/paper-global.yml 并提高以下设置:
chunk-system:
worker-threads: <cores - 1> # 例如,6核主机设为 5
io-threads: 3
默认的 -1 表示“自动”,通常仅分配约 cores / 2 个工作线程——这对于活跃的生存服务器来说非常安全,但在预生成期间会让大部分 CPU 处于空闲状态。插件会在启动日志中打印针对你主机环境的推荐值。
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.
评论 0
登录后参与评分
还没有评论,来抢沙发吧