WorldSlim
通过自动清理玩家极少访问的区块,减小 Minecraft 世界文件大小。三层防御机制拦截了原本会被原版自动保存写入磁盘的数据。
功能介绍
现代 Minecraft(1.18+)会在比玩家视距更长的时间内保持区块加载状态,并且无论玩家是否活动,自动保存都会将它们全部写入磁盘。WorldSlim 钩入了该流程的每一层:
- ChunkUnloadListener — 当区块卸载时,如果
InhabitedTime( inhabitation time,生存时间/占用时间)较低,则拦截保存操作。
- AutosaveShield (2.0 新增) — 每 2 秒一次,预先清除已加载的低
InhabitedTime 区块的脏标记(dirty flag),以便自动保存跳过它们。
- ChunkCleaner — 定期重写区域文件(region files),移除漏过前两层处理的区块。
玩家活动(放置方块、攻击生物、打开容器、拾取/丢弃物品)会将区块标记为“强制保存”,使其免受清理影响。
亮点
- 三层架构 — 卸载 + 自动保存 + 区域重写。激进但安全。
- 基于文件的 ChunkRegistry — 管理/强制保存状态存储在
plugins/WorldSlim/data/ 中,可存活于服务器重启以及 Leaf/Moonrise 对区块 PDC 的剥离。崩溃安全(丢失标记会降级为“勿动”)。
- 激进模式 (
cleanup.aggressive: true) — 恢复 1.0.6 之前的清理逻辑,在新生服务器上可实现 90% 以上的清理率。默认关闭以保护已有世界的建筑。
- 诊断工具 —
/worldslim diagnose 查看运行时计数器,/worldslim scan 检查任意区域文件的原始 NBT,/worldslim chunk 查看你当前所在区块的完整决策树。
- 每日轮换的文件日志记录器,位于
plugins/WorldSlim/logs/,级别可配置。
- 配置迁移 (2.0.1 新增) — 升级时自动注入新字段,保留你的编辑和注释。
- 异步且有限制 — 所有磁盘操作均在主线程之外运行,并设有 5 秒超时,当服务器繁忙时安全跳过。
兼容性
| Server |
PDC Persistence |
Registry |
AutosaveShield |
| Paper 1.21.x |
Yes |
Yes |
Yes |
| Purpur 1.21.x |
Yes |
Yes |
Yes |
| Folia 1.21.x |
Yes |
Yes |
Partial |
| Leaves 1.21.x |
Yes |
Yes |
Yes |
| Leaf 1.21.x |
Stripped |
Load-bearing |
Limited |
需要 Minecraft 1.21.x 和 Java 21。
命令
| Command |
Description |
/worldslim status |
显示插件状态和当前配置 |
/worldslim stats |
扫描/清理的区块总数及节省的空间 |
/worldslim chunk |
你当前所在区块的完整决策树 |
/worldslim cleanup |
立即执行一次清理 |
/worldslim diagnose [here] |
运行时诊断快照。附加 here 可查看当前区块详情 |
/worldslim scan |
解析当前区域文件的原始 NBT 并报告存活的标签 |
/worldslim reload |
重载 config.yml(同时运行配置迁移) |
/worldslim reset |
重置清理统计数据 |
支持别名 /ws。权限:修改类命令需 worldslim.admin;只读命令需 worldslim.use。
快速开始
- 将 jar 放入
plugins/ 目录,重启服务器。
- 默认配置较为保守(会保留任何看起来是预存在的区块)。大多数服务器无需额外配置即可正常运行。
- 在新生服务器上 — 设置
cleanup.aggressive: true 以获得最佳清理率。
- 在已有建筑和内容的服务器上 — 保持
aggressive: false(默认值),让注册表追踪后续新增的区块。
配置亮点
# 区块生命周期阈值。低于此值的区块可能会被清理。
# 默认 1200 ticks = 60 秒。
min-inhabited-time: 1200
cleanup:
interval-minutes: 30
run-on-startup: false
# 1.0.6 之前的清理行为。强烈建议新生服务器使用。
aggressive: false
autosave-shield:
enabled: true
interval-ticks: 40 # 2s
logging:
file-enabled: true
level: INFO # DEBUG / INFO / WARN / ERROR
worlds:
enabled: [] # 若非空,则仅管理这些世界
disabled: [] # 始终跳过的世界
首次运行时生成包含所有注释的完整默认配置。
报告问题
请包含以下内容:
/worldslim diagnose 的截图
plugins/WorldSlim/logs/ 中的最新日志
- 服务器类型和版本
WorldSlim
Reduce Minecraft world file size by automatically cleaning chunks that players barely visit. Three layers of defense catch what vanilla autosave would otherwise commit to disk.
What it does
Modern Minecraft (1.18+) keeps chunks loaded much longer than a player's view distance, and autosave writes them all to disk regardless of activity. WorldSlim hooks every layer of that pipeline:
- ChunkUnloadListener — when a chunk does unload, intercept the save if
InhabitedTime is low.
- AutosaveShield (new in 2.0) — every 2 seconds, pre-emptively clear the dirty flag on loaded low-
InhabitedTime chunks so autosave skips them.
- ChunkCleaner — periodically rewrite region files, removing chunks that slipped through the first two layers.
Player activity (placing blocks, attacking mobs, opening containers, picking up / dropping items) marks chunks as "force-save" so they survive cleanup.
Highlights
- Three-layer architecture — unload + autosave + region rewrite. Aggressive without being unsafe.
- File-based ChunkRegistry — managed/force-save state stored in
plugins/WorldSlim/data/, survives server restarts and Leaf/Moonrise's chunk-PDC strip. Crash-safe (lost marks degrade to "leave it alone").
- Aggressive mode (
cleanup.aggressive: true) — restores the pre-1.0.6 cleanup logic, achieves 90%+ cleanup rate on fresh servers. Off by default to protect builds on established worlds.
- Diagnostics —
/worldslim diagnose for runtime counters, /worldslim scan for raw-NBT inspection of any region file, /worldslim chunk for full decision-tree of the chunk you're standing in.
- Daily-rotating file logger at
plugins/WorldSlim/logs/, configurable level.
- Config migration (new in 2.0.1) — new fields auto-injected on upgrade, preserving your edits and comments.
- Async + bounded — every disk operation runs off the main thread, with a 5-second timeout that safely skips when the server is busy.
Compatibility
| Server |
PDC Persistence |
Registry |
AutosaveShield |
| Paper 1.21.x |
Yes |
Yes |
Yes |
| Purpur 1.21.x |
Yes |
Yes |
Yes |
| Folia 1.21.x |
Yes |
Yes |
Partial |
| Leaves 1.21.x |
Yes |
Yes |
Yes |
| Leaf 1.21.x |
Stripped |
Load-bearing |
Limited |
Requires Minecraft 1.21.x and Java 21.
Commands
| Command |
Description |
/worldslim status |
Show plugin status and active configuration |
/worldslim stats |
Total chunks scanned/cleaned and space saved |
/worldslim chunk |
Full decision tree for the chunk you're standing in |
/worldslim cleanup |
Run a cleanup pass immediately |
/worldslim diagnose [here] |
Runtime diagnostic snapshot. Append here for current-chunk details |
/worldslim scan |
Parse the current region file's raw NBT and report what tags survived |
/worldslim reload |
Reload config.yml (also runs config migration) |
/worldslim reset |
Reset cleanup statistics |
Aliased to /ws. Permission: worldslim.admin for mutating commands; worldslim.use for the read-only ones.
Quick start
- Drop the jar in
plugins/, restart.
- Default config is conservative (preserves any chunks that look pre-existing). Works without configuration on most servers.
- On a fresh server — set
cleanup.aggressive: true for the best cleanup rate.
- On an established server with builds — leave
aggressive: false (default) and let the registry track new chunks going forward.
Configuration highlights
# Chunk lifetime threshold. Below this, chunks may be cleaned.
# Default 1200 ticks = 60 seconds.
min-inhabited-time: 1200
cleanup:
interval-minutes: 30
run-on-startup: false
# Pre-1.0.6 cleanup behavior. Highly recommended for fresh servers.
aggressive: false
autosave-shield:
enabled: true
interval-ticks: 40 # 2s
logging:
file-enabled: true
level: INFO # DEBUG / INFO / WARN / ERROR
worlds:
enabled: [] # if non-empty, ONLY these worlds are managed
disabled: [] # always-skipped worlds
Full default config (with all comments) is generated on first run.
Reporting issues
Please include:
/worldslim diagnose screenshot
- Latest log from
plugins/WorldSlim/logs/
- Server type and version
评论 0
登录后参与评分
还没有评论,来抢沙发吧