Skip to content

Template

Michael Hillcox edited this page Mar 31, 2021 · 2 revisions

Template System

Our template system has been custom made to suit how we think our gadgets should be used. We're definitely not saying you can't go mad with them but we do impose some limitations on how far you can push the system. As of our latest update for 1.16.5 we've been using a custom format that is comprised of a Json Format with a custom compress body and a easy to read Material List

The future

All the below information is valid up until Minecraft 1.16.5. If any changes happen from this point, we will be sure to keep support for the older version of this system. The only thing that would effect this is if Minecraft did a major change to the way they handle Block Pos, Tile Entities or NBT compounds.

That being said, it's been a long term todo list item to rewrite this system to make it simpler for other mods to use. We will be sure to update this page if any further changes come to this system.

1.14+

As of 1.14 we have updated our template system to no longer use a stringified NBT export and instead have opted for the system outline below. Our new system is comprised of two parts, a easy to read (using json parser) material list and a compress body that holds the actual placement data of the template. This system is closely related to the Minecraft Structure system but with a much more efficient way of storing the data to make the files easy to share.

Template Data

The template data is part of the body json property and is a NBT compound of the placement data required for constructing a template in the world. This compound is converted to a byte format then compressed using a common compression method that can be found in detail in our code base. Retrieving this data is relatively trivial if you're already inside Minecraft but can be less simple when having to decompress and parse the NBT data from an external tool.

Material List

The material list is part of the Template Header. The material list is aimed at allowing external tools, other mods and in some cases our mod to read a simple, easy to parse / read set of materials required for the build. This means you do not need to read the compressed body of the template and provides a quick method of finding basic requirements.

1.12 template data

The old 1.12 template is in a similar format to Json but with a few key changes that make it break most Json readers. This is due to the fact that it is simply a .toString of the NBT Compound. Although this originally worked nicely for us, our users quickly out grew it's capability and we soon switched it out for a much better system.