Podshot / MCEdit-Unified

Combined MCEdit & Pymclevel repository.
http://podshot.github.io/MCEdit-Unified/
ISC License
484 stars 109 forks source link

Suggestion: Moving to a new Schematic format for improved MC 1.8+ support #686

Open gabizou opened 8 years ago

gabizou commented 8 years ago

As some people may be aware, Minecraft's internals moved from using a pair of int ids, representing a block id and metadata, to BlockStates, a table based system of block id and property/value pairs. In storage, to avoid an entire world format change, they are still serialized back to their original int id pairs, but, schematics can greatly benefit by moving away from such systems.

SpongePowered has developed a work-in-progress API and implementation in support of a new Schematic format that aims to take advantage of a Palette system to reduce schematic sizes. Likewise, this format takes advantage of not requiring modded block id's to be re-assigned or "fixed' when importing between servers/installations/versions since the state id's already provide all the information required.

The major advantage of this new format is that adding various metadata, such as versions will help introduce a more stable and future compatible system for various implementations using said format to reduce user maintenance of older schematics.

There was some discussion about the palette system used, and the results are quite illuminating.

The largest benefit of all of this new schematic format is improved versioning support when importing schematics into worlds with various implementations (such as Sponge or Paper or WorldEdit).

Podshot commented 8 years ago

To be completely honest (and my opnion), now that Mojang has added structure blocks and a way of saving in-game builds to a file, that will probably be the new "schematic" format. And since the old one uses Block IDs, it will probably break once Mojang makes the complete switch. However, I will look into this new format and I will try to add support for it once I can.

Deamon5550 commented 8 years ago

@Podshot Yeah its good to support their new structure format, but since it stores a 3-int block pos per block its certainly not going to replace the usefulness of a schematic format for larger areas.

Podshot commented 7 years ago

Sorry to bump an old issue, but from what I've looked into regarding this new format, I don't see a lot of other programs/apis using or supporting the new format. If you could give me links to some, I'll take a look and reconsider. However, as of right now I'm going to close this issue in a few days since I cant find much info on it.

Deamon5550 commented 7 years ago

@Podshot Sponge uses it, as its the only format that can support mods properly. And especially come 1.13 with the flattening of all blockstates and the removal of a lot of the metadata values the older schematic format makes a lot less sense. And since I've not seen any talk of updating it (although I haven't looked around much in a while) I would say that sponge's schematic format is the best format going forward.

Podshot commented 7 years ago

I've decided to start implementing this format since the .nbt format, while would probably support blockstates, can't handle big structures. Would you be able to supply some example files of the format so I can have some files to test our parser against?

gabizou commented 7 years ago

I'll get a schematic written up in a bit, I have a relatively large collection of things to make schematics with that I've tested pasting with sponge. Give me a few days.

gabizou commented 5 years ago

So... Rehashing this old conversation: Since we've moved on to add an update to the schematic format in Verson 2, I'm not sure if there's a rekindling effort to be made here. It seems that while MCEdit has added some support for up to 1.12.x, I don't know if it'd be worth maybe adding the format as supported due to the nature that the schematic format embeds the Minecraft DataVersion as a requirement now, so that forward and backward compatibility can potentially be achieved (block state changes, the flattening, etc.).

However, I'd like to make note: The format is now the only supported format to export schematics using WorldEdit moving forward, while the older formats are still supported for importing, but not exporting.