FastChunkGen 在所有 CPU 核心上生成区块,在后台保存和加载它们,并修复原版线程 bug 等。
在新世界中,它的预生成速度比原版 Forge 快约 5 倍。
Forge 1.20.1 | 服务端与客户端 | 稳定版
它做什么?
此模组在你拥有的每个核心(可配置)上生成区块工作,并将区块的保存和加载移出服务器线程。
功能

- 噪声、地表、挖掘器、特性和光照都在根据你的 CPU 大小配置的线程池上运行。
- 多个区块同时生成,而不是排队等待。

- 区块在后台加载和保存,因此自动保存和快速旅行不再导致服务器冻结。
- 更快的压缩速度和针对近期读取过的区块数据的缓存。

- 优化了含水层、噪声采样、地表规则和随机数生成。
- 相邻区块共享原本需要各自计算的噪声数据。

- 无论是否安装此模组,相同的种子都会生成相同的地形、洞穴和含水层。
- 每次世界生成更改在发布前都会逐区块与原版 Forge 进行比较。

- 光照引擎拥有自己的线程,而不是与其他所有内容共享一个线程。

- 异步保存仍会在服务器线程上触发 Forge 的
ChunkDataEvent.Save,因此那些在区块中存储额外数据的模组仍能保留数据。其他移植版本通常会跳过这一步。 - 模组机器和容器在服务器线程上保存,而非由工作线程读取。
- 如果一个区块在其保存任务仍在队列中时再次加载,它将获取新数据,而不是磁盘上的旧副本。
- 失败的世界生成任务会重试,因此地图的任何部分都不会卡住且无法生成。
- 当模组从错误的线程操作世界时,日志会指明模组的名称和方法。警告频率受限,以免刷屏日志。

- 启动时,模组会检查已安装的其他内容。如果另一个模组已经优化了相同的代码,本模组将自动关闭。
- 被许多整合包使用,特别是 Linggango。
基准测试

专用服务器,新世界,种子为 25(没错就是 25),Chunky 使用默认半径。Ryzen 7 7800X3D(16 线程),8 GB 堆内存,所有设置均为默认值。为了获得准确的基准测试结果,我运行了 10 次!
我还要提一下,结果会有所不同。尤其是你安装的模组数量。如果你有很多模组,这个模组的效果可能会更加明显或减弱……谁知道呢。
配置

所有设置均在 config/fastchunkgen.toml 中。
| 选项 | 默认值 | 备注 |
|---|---|---|
globalExecutorParallelism |
基于你的 CPU | 用于世界生成和区块 IO 的工作线程 |
threadedWorldGen.enabled |
开启 | 至少需要 3 个工作线程 |
ioSystem.async |
开启 | 后台区块加载和保存 |
threadedLighting.enabled |
开启 | |
ioSystem.recoverFromErrors |
开启 | 再生成加载失败的区块而不是崩溃,如同原版行为 |
ioSystem.gcFreeChunkSerializer |
关闭 | 保存更快,但会跳过 Forge 保存事件。会破坏依赖存储区块数据的模组 |
fixes.enforceSafeWorldRandomAccess |
关闭 | 在不安全的线程访问时直接崩溃而不是警告。有助于查找有问题的模组 |
常见问题
它会改变世界生成吗?
- 不会。居然有人问这个问题,为什么这要放在 FAQ 里。
我在客户端需要安装它吗?
- 不需要,但你应该在单人游戏中也保持客户端安装以获得更好的体验。
我可以将其添加到现有世界中吗?
- 可以。
出现了问题。
- 在 GitHub 上提交 Issue
致谢
- 原始模组 C2ME,由 RelativityMC 和 ishland 开发。
- Forge 移植版基础由 sj-hub9796 提供。
FastChunkGen generates chunks on all of your CPU cores, saves and loads them in the background, and fixes the vanilla threading bugs, etc.
On a fresh world it pregenerates about 5x faster than plain forge.
Forge 1.20.1 | Server and client | Stable
What does it do?
This mod generates chunk work on every core you have (configurable) and moves chunk saving and loading off the server thread.
Features

- Noise, surface, carvers, features and lighting run on a worker pool sized to your CPU.
- Several chunks generate at once instead of waiting in line.

- Chunks load and save in the background, so autosaves and fast travel stop freezing the server.
- Faster compression and a cache for chunk data that was read recently.

- Optimized aquifers, noise sampling, surface rules and random number generation.
- Close chunks share the noise they would otherwise both calculate.

- A seed gives you the same terrain, caves and aquifers with or without the mod.
- Every worldgen change is compared chunk by chunk against plain Forge before it ships.

- The light engine gets its own thread instead of sharing one with everything else.

- Async saves still fire Forge's
ChunkDataEvent.Saveon the server thread, so mods that store extra data in chunks keep it. Other ports just skip this.. - Modded machines and containers are saved on the server thread, not read by a worker.
- A chunk that loads again while its save is still queued gets the new data, not the old copy on disk.
- Worldgen tasks that fail are retried, so no part of the map gets stuck and never generates.
- When a mod touches the world from the wrong thread, the log names the mod and the method. The warning is rate limited so it can't spam your logs.

- At startup the mod checks what else is installed. If another mod already optimizes the same code, this mods turns off
- Used in a lot of modpacks, specifically in Linggango.
Benchmark

A dedicated server, fresh world, seed is 25 (yes just 25), Chunky at its default radius. Ryzen 7 7800X3D (16 threads), 8 GB heap, everything on default settings. For accurate benchmark, I ran it 10 times!
I also wanna mention that results will vary. The amount of you mods especially. If you have ton of mods this mod will show its benefits even more or less.. who knows
Config

All settings are in config/fastchunkgen.toml.
| Option | Default | Notes |
|---|---|---|
globalExecutorParallelism |
Based on your CPU | Worker threads for worldgen and chunk IO |
threadedWorldGen.enabled |
On | Needs at least 3 workers |
ioSystem.async |
On | Background chunk loading and saving |
threadedLighting.enabled |
On | |
ioSystem.recoverFromErrors |
On | Regenerates a chunk that fails to load instead of crashing, like vanilla |
ioSystem.gcFreeChunkSerializer |
Off | Faster saves, but skips Forge save events. Breaks mods that store chunk data |
fixes.enforceSafeWorldRandomAccess |
Off | Crashes on unsafe thread access instead of warning. Useful for finding broken mods |
FAQ
Does it change world generation?
- No. Will anyone even ask this, why is this in FAQ.
Do I need it on the client?
- No, but u should keep it on client for singleplayer use and more.
Can I add it to an existing world?
- Yes.
Something broke.
- Open an issue on GitHub
Credits
- Original mod, C2ME, by RelativityMC and ishland.
- Forge port base by sj-hub9796.
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 FastChunkGen
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复 #34 和 #35
修复 #33 以及 Lost Cities 的死锁问题,同时减少世界生成时的卡顿(GC 分配相关的问题)
所谓的“空区块”或你叫它什么都行,这是与 byepregen 的不兼容问题……已修复
进一步减少 GC 压力(生成区块时卡顿更少)……
我知道我一直在重复同样的废话,但事实如此。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
评论 0
登录后参与评分
还没有评论,来抢沙发吧