Skip to content

Flattening

mineLdiver edited this page Jul 26, 2023 · 1 revision

StationAPI partially backports modern Minecraft's world save format, named Flattening.

Why?

Vanilla save format limitations

Minecraft Beta 1.7.3's world save format is extremely limited and unfit for extensively modded environments.

It only allows 256 unique blocks (159 if we subtract all the vanilla blocks) and 32000 unique items.

While main concern is blocks, items are also affected by this change.

StationAPI allows 2^31-1 (2147483647) unique blocks and the same number of unique items, effectively removing vanilla save format limitations.

Custom world height

As another feature of flattening, StationAPI introduces customizable world height for all dimensions. In theory, it's possible to have worlds with height of 65536 blocks, but going too extreme might also have a huge performance impact.

Block states

Vanilla save format allows blocks to have custom sub-types using metadata. But, one block can only have 16 (0-15) metadata values. Those are also raw numbers, so they don't have some proper meaning behind them, you have to study the block's class to actually understand what each value means when getting it from the world.

However, flattening brings block states. Basically, unlimited, better structured metadata. Block states can have all sorts of properties appended to them, such as rotation, on/off state, age, etc etc. They're nicer to deal with and allow for better integration with data-driven renderer models.

How about vanilla save format worlds?

StationAPI provides an in-game converter from and to vanilla save format, so you can migrate your world to StAPI or go back to vanilla if you want to.

Performance impact?

Flattening does have a slight impact on performance, such is the cost of replacing a primitive byte array with a more complex, flexible structure. But it should be mostly negligible. (Currently, there's also an issue with lighting engine that makes world generation take way longer than it should. It's being investigated)

Vanilla servers compatibility?

StationAPI clients do have the ability to join vanilla servers. Vanilla world manager simply kicks in and disables all flattening-exclusive features.

Vanilla clients compatibility?

StationAPI servers, as of now, cannot accept vanilla clients. Network manager requires some work in order to allow this, and it's not currently a priority.

Clone this wiki locally