介绍
NotEnoughPalette (NEP) — Optimize Minecraft’s PalettedContainer.
NEP is a transparent, drop-in replacement for Minecraft’s PalettedContainer, the data structure behind block and biome storage in every chunk section. It replaces vanilla’s bit-packed SimpleBitStorage storage with instant direct-array access — no bit packing, no cell-index math — while remaining wire-compatible with vanilla so it can be added or removed at any time without world or network issues.
How it works
Each chunk section picks the storage mode that fits its contents:
| Mode | Storage | Use |
|—|—|—|
| SingleStorage | single value | uniform sections (e.g. all-air) |
| IndirectStorage | byte[4096] + palette (≤256 types) | typical sections |
| CharGlobalStorage | char[4096] global IDs | diverse sections (>256 types) |
| IntGlobalStorage | int[4096] global IDs | extreme modpacks (>65535 blocks) |
Every mutation path is optimized: factory creation, codec deserialization, network read/write, copy and recreate. Memory usage is ≤1.5× vanilla for typical sections, often less.
Performance
Benchmarked with 125 TNT on a 24-core i9-12900HX (Minecraft 26.2, Lithium 0.25.0 enabled in both configs, NEP the only difference):
| Metric | Lithium | Lithium + NEP |
|—|—|—|
| TPS (1m) | 13.73 | 13.99 |
| MSPT (mean) | 201.9 ms | 192.6 ms |
| MSPT (95%ile) | 252.8 ms | 241.9 ms |
| MSPT (max) | 542.4 ms | 495.1 ms |
On top of Lithium alone, NEP delivers -4.6% mean MSPT, -4.3% p95, -8.7% max, and +1.9% TPS.
Compatibility
- Fabric (Loader ≥ 0.19.3) and NeoForge (≥ 26.2.0.1-beta) in a single hybrid JAR
- Pure client / pure server optional — PalettedContainer runs on both sides, and NEP’s serialized format is byte-identical to vanilla, so clients without NEP connect fine to NEP servers and vice versa
- Works alongside performance mods like Lithium and Sodium
常见问题
NotEnoughPalette 支持哪些 Minecraft 版本?
NotEnoughPalette 支持 Minecraft Java 版 26.2–26.3,共 2 个版本,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。
NotEnoughPalette 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
评论
登录后评论和评分