WorldSlim
A lightweight chunk save optimization plugin for Paper servers. WorldSlim reduces your world file size by automatically cleaning up chunks that players have barely visited.
Список изменений
WorldSlim 2.0.0-beta
Beta release — architectural overhaul. Back up
plugins/WorldSlim/before upgrading from 1.x.
Major rewrite to properly handle MC 1.18+ chunk behavior. 1.0.x worked by intercepting chunk unloads, but modern MC keeps chunks loaded much longer and autosave writes them to disk before any unload event fires. This version rebuilds the architecture around that reality.
What's New
File-Based Chunk Registry
Managed and force-save chunk states are now stored in plugins/WorldSlim/data/ instead of the chunk's PersistentDataContainer.
Why it matters: Leaf / Moonrise silently strips Bukkit PDC data when chunks are saved — on 1.0.x this caused the cleaner to see every chunk as "pre-existing" and delete nothing. The registry survives restarts and doesn't depend on server fork behavior.
- In-memory
ConcurrentHashMapwith O(1) lookups - Async flush every 30 seconds, synchronous flush on shutdown
- Crash-safe: lost marks degrade to pre-existing (never accidentally deleted)
- Works identically on Paper, Purpur, Folia, Leaves, and Leaf
AutosaveShield
A background task that periodically resets the NMS unsaved flag on loaded low-inhabited managed chunks, so autosave skips them.
- Runs every 2 seconds by default (configurable)
- Targets only chunks that are managed + low InhabitedTime + not force-saved
- On supported cores (Paper, Purpur), it achieves zero disk writes for pure-exploration chunks
- Limited effect on Moonrise (it has its own dirty tracking); pair with aggressive mode below
Aggressive Mode
Set cleanup.aggressive: true in config.yml to restore pre-1.0.6 behavior: any chunk below the InhabitedTime threshold without force-save gets cleaned, regardless of managed status.
- Recommended for fresh servers — cleanup rate jumps back above 90%
- Not recommended for established worlds with builds on briefly-visited chunks (signs, dust, fast stops) — those may have low InhabitedTime and would be deleted
Diagnostics
/worldslim diagnose [here]— full runtime snapshot (event counts, marking sources, unload decisions, cleanup breakdown, registry totals). Addhereto inspect the chunk you're standing in./worldslim scan— dumps the NBT structure of your current region file so you can verify whether PDC actually persists on your server fork.- File logger at
plugins/WorldSlim/logs/worldslim-YYYY-MM-DD.log, daily rotation, level-configurable.
Fixes
- Paper 1.20.5+ NBT key compatibility — chunk PDC was renamed from
BukkitValuestoChunkBukkitValues; 1.0.x never recognized it. The parser now accepts both. - Main-thread deadlock —
getLoadedChunks()could block forever and latch the "cleanup in progress" state. 5-second timeout added; timeouts safely skip the world. - Registry / disk drift — removal marks are now deferred until the region rewrite atomically commits. Aborted rewrites no longer corrupt the registry.
- Windows region-file loss — three-tier fallback switched to a backup-rename pattern; any failure is now recoverable.
- NPE on post-rewrite timeout — the loaded-chunks recheck no longer crashes when the callback times out.
/worldslim scanserver freeze — removed the synchronousWorld.save()call that stalled the server for seconds./worldslim cleanupmisleading message — now correctly reports "cleanup skipped: another run is in progress" instead of falsely claiming completion.- Large-world cleanup slowdowns — removed per-region main-thread round-trip; saves hundreds of synchronization bounces per run.
Compatibility
| Server | PDC Persistence | Registry | AutosaveShield |
|---|---|---|---|
| Paper 1.21.x | ✅ | ✅ | ✅ |
| Purpur 1.21.x | ✅ | ✅ | ✅ |
| Folia 1.21.x | ✅ | ✅ | ⚠️ partial |
| Leaves 1.21.x | ✅ | ✅ | ✅ |
| Leaf 1.21.x | ❌ stripped | ✅ load-bearing | ⚠️ limited |
Requires Minecraft 1.21.x and Java 21.
Upgrade from 1.x
- Back up
plugins/WorldSlim/(config + any future data). - Replace the jar with
WorldSlim-2.0.0-beta+mc1.21.x.jar. - Restart the server. The plugin will append new config fields (
cleanup.aggressive,autosave-shield.*,logging.*) to your existingconfig.yml. - On fresh worlds, set
cleanup.aggressive: truefor best cleanup rate. - On established worlds, keep
aggressive: falseand trust the registry to track new chunks going forward.
Reporting Issues
When filing a bug, please include:
/worldslim diagnosescreenshot/worldslim scanoutput from the affected world- Latest log from
plugins/WorldSlim/logs/ - Server type and version (Paper / Leaf / etc.)
