A hash index for Sable's per-state physics property tables. Nothing else changes.
The problem
Sable 2.0.x attaches physics properties (mass, friction, restitution…) per block state through physics_block_properties. When a datapack enumerates states exhaustively — copyfoxies 2.2.0 does, 15,325 entries with two edge_cut_prism blocks at 5,184 states each — the apply pass becomes a nested scan of states × overrides: 59.4 million comparisons per dimension, measured at 18.9 s. And it runs twice: once per dimension on the server (applyAll()), and once per join on the client, which receives one packet per definition and scans each one (applyToBlocks()).
Net effect: ~72 s of server-side waiting before Preparing start region, then another ~13 s of client freeze.
After installing
| before | after | |
|---|---|---|
Server, 4 dimensions → Preparing start region |
~72 s | 743 ms |
| Server, full pass (200 definitions / 376,073 states) | ~18.9 s per dimension | 88 ms |
| Client world join | ~13 s freeze | tens of milliseconds |
| Physics values | — | byte-identical |
Repeated dimensions cost nothing: if the dataset has not changed since the last pass, the whole apply step is skipped.
How it works
- Inverts the loops: compute one property-value tuple per state, one hash lookup, apply whatever matched;
- Skips the pass entirely when the dataset is field-for-field identical to the last one (a datapack reload that changes data re-runs it automatically — no restart needed);
- If a definition mixes several key shapes (rare), that definition falls back to Sable's original per-state logic — slower, never guessed. Any runtime error is logged and handed back to the original implementation.
No data is modified, no world data is written, there is no config. Behaviour and values are exactly equivalent.
Requirements
- Minecraft 1.21.1 / NeoForge 21.1+
- Required: Sable
2.0.6–2.0.x - Client and server
- Coexists with copyfoxies, aviation, Create: Atmospherics, Copycats+ and any other mod shipping
physics_block_properties; it does almost nothing when no such data is present