Chunker - 官方支持与下载
加入我们的 Discord 社区 以获取帮助、支持、问题反馈、意见交流及讨论。
点击此处加入:Join Our Discord
贡献
欢迎提交 PR
本仓库为公开仓库。Fork 该仓库,创建分支,然后提交拉取请求(Pull Request)。我会合并那些有效且不会引入问题的更改。如果需要修改,我会留下反馈。
快速检查清单:
- 如有相关 Issue,请链接。
- 添加简短描述和测试步骤。
- 必须使用 Java 25 通过
mvn clean package 构建。
支持的 MC 版本
- 目标版本:
26.1.2
- 需要 Java 25
- 较旧的 Java 21 / pre-26.1.2 服务器构建不再被 26.1.2 及更高版本支持
支持的服务器
- Paper
- Folia
- 兼容 Paper 的 Fork,如 Pufferfish、Purpur 和 Leaf
Chunker 仍为非 Paper 服务器路径保留回退逻辑,但当前插件基线是基于 26.1.2 API 和 Java 25 构建的。
概述
Chunker 旨在比传统的预生成器更高效且更具韧性。许多预生成器会在内存中追踪数千个区块,如果服务器崩溃,可能会导致严重的回滚或数据丢失。相比之下,Chunker 仅追踪最小状态,如当前迭代器位置、已提交的进度、已完成进度以及生成中心,因此崩溃或重启对生成过程的影响较小。
Chunker 在 Paper 及其 Fork 上表现最佳,因为它可以通过 CompletableFuture 使用异步区块加载。Folia 使用其区域调度器路径。在非 Paper 服务器路径上,Chunker 会回退到同步加载行为。
您可以配置 Chunker 仅在没有玩家在线时自动运行,并在有玩家加入时暂停。此行为由 settings.yml 中的 auto_run 控制。您还可以通过更改 task_queue_timer 和 parallel_tasks_multiplier 来调整每个维度的运行激进程度。
优化的 JVM 启动参数 (start.bat)
查看 run.bat 源代码
@echo off
for %%f in (*.jar) do set JAR=%%f
REM Launching Java with Aikar-style flags
java ^
-Xms1G ^
-Xmx30G ^
-XX:+UseG1GC ^
-XX:+UnlockExperimentalVMOptions ^
-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 ^
-XX:SurvivorRatio=32 ^
-XX:+PerfDisableSharedMem ^
-XX:MaxTenuringThreshold=1 ^
-XX:+UseCompressedOops ^
-XX:+DisableExplicitGC ^
-XX:+AlwaysPreTouch ^
-XX:+ParallelRefProcEnabled ^
-XX:+UseNUMA ^
-XX:ParallelGCThreads=16 ^
-XX:ConcGCThreads=16 ^
-XX:MaxGCPauseMillis=50 ^
-Dusing.aikars.flags=https://mcflags.emc.gs ^
-Daikars.new.flags=true ^
-jar "%JAR%" --nogui
pause
Xms1G 和 Xmx30G 应更新以匹配服务器的最小和最大内存。
- 更新
XX:ParallelGCThreads 和 XX:ConcGCThreads 以匹配您的 CPU 线程数。
Paper 配置
注意: 在非 Paper 服务器上,Paper 异步区块功能将不会被使用。
在基于 Paper 的服务器上,您可以调整区块生成和 I/O 并行度以获得更好的预生成吞吐量。
在您的 paper-global.yml 或等效配置文件中,考虑增加区块生成和 I/O 的并行度:
chunk-loading-advanced:
auto-config-send-distance: true
player-max-concurrent-chunk-generates: -1
player-max-concurrent-chunk-loads: -1
chunk-loading-basic:
player-max-chunk-generate-rate: -1.0
player-max-chunk-load-rate: -1.0
player-max-chunk-send-rate: -1.0
chunk-system:
gen-parallelism: default
io-threads: 16
worker-threads: 16
region-file-cache-size: 16
- 调整
io-threads 和 worker-threads 以匹配或接近您的 CPU 线程数。
- 默认情况下,Paper 可能不会为区块工作使用所有可用的 CPU 线程。
- 如果在没有玩家在线的全新世界上进行预生成,请降低
region-file-cache-size。
命令用法
主要命令如下:
/pregen <ParallelTasksMultiplier> <PrintUpdateDelay> <dimension> <Radius or "default"> [safety]
/pregenoff [dimension]
/pregen reset <dimension>
示例
-
/pregen 4 10s minecraft:overworld default
- 预生成主世界。
- 每个调度周期排队 4 个区块加载任务。
- 每 10 秒打印一次进度日志。
default 使用世界边界作为半径。
-
/pregen 6 5s minecraft:overworld 1000b
- 预生成主世界。
- 每个调度周期排队 6 个任务。
- 每 5 秒打印一次日志。
1000b 表示 1000 格半径,四舍五入至完整区域覆盖。
-
/pregen 16 5s minecraft:the_nether 2r safety
- 预生成下界。
- 使用
16 乘数以并行方式排队安全模式工作。
- 每 5 秒打印一次日志。
2r 表示 2 个区域半径,四舍五入至完整区域覆盖。
safety 强制使用更保守的紧急异步生成路径。
-
/pregen 1 12h minecraft:the_end 100r
- 预生成末地。
- 每个调度周期排队 1 个任务。
- 每 12 小时记录一次日志。
100r 表示 100 个区域半径。
-
/pregen reset minecraft:the_nether
命令参数
- ParallelTasksMultiplier: 决定每个调度器周期中排队多少个区块加载任务。在 Paper 上,这些任务使用异步区块 API。较高的值可以提高吞吐量,但也会增加 CPU、内存和磁盘压力。
- PrintUpdateDelay: 进度日志出现的频率。可添加后缀
s、m 或 h。
- dimension: 要预生成的维度。请使用规范的命名空间键,例如
minecraft:overworld 或 minecraft:the_nether。支持 Tab 补全。
- Radius: 目标半径,需带后缀:
b - 方块,例如 20000b
c - 区块,例如 500c
r - 区域,例如 30r
default - 使用世界边界
- safety: 可选。在 Paper 上强制启用保守的紧急异步安全路径。
- /pregenoff [dimension]:
- 无参数 = 停止所有正在进行的预生成任务。
- 带维度键 = 仅停止该维度的任务。
权限
默认需要 OP 权限。
chunker.pregen - 允许使用 /pregen 命令
chunker.pregenoff - 允许使用 /pregenoff 命令
chunker.reset - 允许使用 /pregen reset <dimension> 命令
chunker.* - 授予所有 Chunker 权限
配置:settings.yml
# World Configuration for Chunker Plugin
# auto_run: Set to true if you want pre-generation to start automatically when no players are on the server.
# Acceptable values: true or false
# task_queue_timer: Determines how fast chunks are queued up. A value between 50-70 is recommended for modern AMD 5000 series and Intel 13th Gen CPUs in the Overworld.
# Adjust based on performance needs.
# parallel_tasks_multiplier: Sets how many async tasks are queued per scheduler cycle. 'auto' will distribute tasks based on your thread count for auto-run.
# You can also set a specific integer value. Higher values increase load.
# print_update_delay: How often to print information (s-Seconds, m-Minutes, h-Hours). Default is 5s.
# radius: Defines how far the pre-generator should run (b-Blocks, c-Chunks, r-Regions) or 'default' to pre-generate until the world border.
# Optional command safety mode:
# Add 'safety' after the radius to force Chunker's urgent async safety generation path on modern versions.
# Example: /pregen 4 5s minecraft:overworld 5r safety
# This keeps progress tied to completed chunks while still queuing safety work in parallel.
# center: Sets where the pregen spiral starts.
# - 'default' uses the world border center, or the world spawn if no border center is set.
# - '~ ~' always uses the current world spawn.
# - 'x z' uses fixed block coordinates, for example: "0 0" or "1500 -500".
minecraft:overworld:
center: default
auto_run: false
task_queue_timer: 60
parallel_tasks_multiplier: auto
print_update_delay: 5s
radius: default
minecraft:the_nether:
center: default
auto_run: false
task_queue_timer: 60
parallel_tasks_multiplier: auto
print_update_delay: 5s
radius: default
minecraft:the_end:
center: default
auto_run: false
task_queue_timer: 60
parallel_tasks_multiplier: auto
print_update_delay: 5s
radius: default
快速提示
- 从较低的
ParallelTasksMultiplier 开始,然后在监控 CPU、内存和磁盘使用情况的同时逐步向上调整。
- Paper 和 Folia 路径提供的性能远优于同步的 Bukkit 风格加载。
- 将
print_update_delay 设置为 10s 或更长,以避免长时间运行期间产生过多的日志输出。
- 仅在希望采用更保守的 Paper 生成路径时使用
safety;若追求最大速度请省略它。
Chunker - Official Support & Downloads
Join our Discord Community for help, support, issues, feedback, and discussions.
Click here to join: Join Our Discord
Contributions
PRs welcome
This repository is public. Fork the repo, create a branch, and open a pull request. I will merge changes that work and do not introduce issues. If I need changes I will leave feedback.
Quick checklist:
- Link the related issue if any.
- Add a short description and steps to test.
- Build must pass with
mvn clean package using Java 25.
Supported MC Versions
- Target version:
26.1.2
- Requires Java 25
- Older Java 21 / pre-26.1.2 server builds are no longer supported by 26.1.2 and newer
Supported Servers
- Paper
- Folia
- Paper-compatible forks such as Pufferfish, Purpur, and Leaf
Chunker still has fallback logic for non-Paper server paths, but the current plugin baseline is built for the 26.1.2 API and Java 25.
Overview
Chunker is designed to be more efficient and resilient than traditional pre-generators. Many pre-generators track thousands of chunks in memory, risking significant rollback or data loss if the server crashes. Chunker, by contrast, only tracks minimal state like the current iterator position, submitted progress, completed progress, and the generation center, so crashes or restarts have less impact on the generation process.
Chunker works best on Paper and Paper forks because it can use asynchronous chunk-loading through CompletableFuture. Folia uses its region scheduler path. On non-Paper server paths, Chunker falls back to synchronous loading behavior.
You can configure Chunker to run automatically only when there are no players online and to halt if a player joins. This behavior is controlled by auto_run in settings.yml. You can also adjust how aggressively each dimension runs by changing task_queue_timer and parallel_tasks_multiplier.
Optimized JVM Launch Parameters (start.bat)
View run.bat Source Code
@echo off
for %%f in (*.jar) do set JAR=%%f
REM Launching Java with Aikar-style flags
java ^
-Xms1G ^
-Xmx30G ^
-XX:+UseG1GC ^
-XX:+UnlockExperimentalVMOptions ^
-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 ^
-XX:SurvivorRatio=32 ^
-XX:+PerfDisableSharedMem ^
-XX:MaxTenuringThreshold=1 ^
-XX:+UseCompressedOops ^
-XX:+DisableExplicitGC ^
-XX:+AlwaysPreTouch ^
-XX:+ParallelRefProcEnabled ^
-XX:+UseNUMA ^
-XX:ParallelGCThreads=16 ^
-XX:ConcGCThreads=16 ^
-XX:MaxGCPauseMillis=50 ^
-Dusing.aikars.flags=https://mcflags.emc.gs ^
-Daikars.new.flags=true ^
-jar "%JAR%" --nogui
pause
Xms1G and Xmx30G should be updated to match your server's minimum and maximum memory.
- Update both
XX:ParallelGCThreads and XX:ConcGCThreads to match your CPU thread count.
Paper Config
Note: On non-Paper servers, Paper async chunk functionality will not be used.
On Paper-based servers, you can tune chunk generation and I/O parallelism for better pre-generation throughput.
In your paper-global.yml or equivalent, consider increasing the parallelism for chunk generation and I/O:
chunk-loading-advanced:
auto-config-send-distance: true
player-max-concurrent-chunk-generates: -1
player-max-concurrent-chunk-loads: -1
chunk-loading-basic:
player-max-chunk-generate-rate: -1.0
player-max-chunk-load-rate: -1.0
player-max-chunk-send-rate: -1.0
chunk-system:
gen-parallelism: default
io-threads: 16
worker-threads: 16
region-file-cache-size: 16
- Adjust
io-threads and worker-threads to match or approach your CPU's thread count.
- By default, Paper may not use all available CPU threads for chunk work.
- Lower
region-file-cache-size if running pre-generation on a fresh world with no players online.
Command Usage
The primary commands are:
/pregen <ParallelTasksMultiplier> <PrintUpdateDelay> <dimension> <Radius or "default"> [safety]
/pregenoff [dimension]
/pregen reset <dimension>
Examples
-
/pregen 4 10s minecraft:overworld default
- Pre-generates the overworld.
- Queues 4 chunk-loading tasks per scheduler cycle.
- Prints progress logs every 10 seconds.
default uses the world border as the radius.
-
/pregen 6 5s minecraft:overworld 1000b
- Pre-generates the overworld.
- Queues 6 tasks per scheduler cycle.
- Prints logs every 5 seconds.
1000b means a 1000-block radius, rounded to full region coverage.
-
/pregen 16 5s minecraft:the_nether 2r safety
- Pre-generates the Nether.
- Queues safety-mode work in parallel using the
16 multiplier.
- Prints logs every 5 seconds.
2r means a 2-region radius, rounded to full region coverage.
safety forces the more conservative urgent async generation path.
-
/pregen 1 12h minecraft:the_end 100r
- Pre-generates The End.
- Queues 1 task per scheduler cycle.
- Logs every 12 hours.
100r means a 100-region radius.
-
/pregen reset minecraft:the_nether
- Deletes saved pre-generation progress for the Nether.
Command Parameters
- ParallelTasksMultiplier: Determines how many chunk-loading tasks are queued per scheduler cycle. On Paper, these tasks use async chunk APIs. Higher values can increase throughput but also increase CPU, memory, and disk pressure.
- PrintUpdateDelay: How often progress logs appear. Add suffix
s, m, or h.
- dimension: The dimension to pre-generate. Use canonical namespaced keys such as
minecraft:overworld or minecraft:the_nether. Tab completion is supported.
- Radius: The target radius with a suffix:
b - Blocks, for example 20000b
c - Chunks, for example 500c
r - Regions, for example 30r
default - Uses the world border
- safety: Optional. Forces the conservative urgent async safety path on Paper.
- /pregenoff [dimension]:
- No args = stops all active pre-generation tasks.
- With a dimension key = stops that dimension only.
Permissions
Defaults to OP.
chunker.pregen - Allows use of /pregen
chunker.pregenoff - Allows use of /pregenoff
chunker.reset - Allows use of /pregen reset <dimension>
chunker.* - Grants all Chunker permissions
Configuration: settings.yml
# World Configuration for Chunker Plugin
# auto_run: Set to true if you want pre-generation to start automatically when no players are on the server.
# Acceptable values: true or false
# task_queue_timer: Determines how fast chunks are queued up. A value between 50-70 is recommended for modern AMD 5000 series and Intel 13th Gen CPUs in the Overworld.
# Adjust based on performance needs.
# parallel_tasks_multiplier: Sets how many async tasks are queued per scheduler cycle. 'auto' will distribute tasks based on your thread count for auto-run.
# You can also set a specific integer value. Higher values increase load.
# print_update_delay: How often to print information (s-Seconds, m-Minutes, h-Hours). Default is 5s.
# radius: Defines how far the pre-generator should run (b-Blocks, c-Chunks, r-Regions) or 'default' to pre-generate until the world border.
# Optional command safety mode:
# Add 'safety' after the radius to force Chunker's urgent async safety generation path on modern versions.
# Example: /pregen 4 5s minecraft:overworld 5r safety
# This keeps progress tied to completed chunks while still queuing safety work in parallel.
# center: Sets where the pregen spiral starts.
# - 'default' uses the world border center, or the world spawn if no border center is set.
# - '~ ~' always uses the current world spawn.
# - 'x z' uses fixed block coordinates, for example: "0 0" or "1500 -500".
minecraft:overworld:
center: default
auto_run: false
task_queue_timer: 60
parallel_tasks_multiplier: auto
print_update_delay: 5s
radius: default
minecraft:the_nether:
center: default
auto_run: false
task_queue_timer: 60
parallel_tasks_multiplier: auto
print_update_delay: 5s
radius: default
minecraft:the_end:
center: default
auto_run: false
task_queue_timer: 60
parallel_tasks_multiplier: auto
print_update_delay: 5s
radius: default
Quick Tips
- Begin with a lower
ParallelTasksMultiplier, then adjust upward while watching CPU, memory, and disk usage.
- Paper and Folia paths provide much better performance than synchronous Bukkit-style loading.
- Use
print_update_delay of 10s or longer to avoid excessive log output during long runs.
- Use
safety only when you want the more conservative Paper generation path; omit it for maximum speed.
评论 0
登录后参与评分
还没有评论,来抢沙发吧