Mojira Archive
MC-132284

Upgrade paths for loading structure files are slow

The bug

When you try to load a structure, it updates all the Blocks and Palette(s) values if the DataVersion version is below the value of the version you're using. This upgrading is super slow. For a structure with a dimension of 32*32*32, it can take 20 seconds to 2 whole minutes. 

After the structure is loaded once, it loads fast again (presumably since the structure gets saved to memory, with remembers the updated version), but after you do /reload or after you leave and rejoin the world, it is slow again.

How to reproduce

You can use the datapack provided to load a structure from 15a, and a structure from 1.13-pre5 (they both have the same blocks/palette; they only include andesite blocks)

  1. Reload the world
  2. Run these two functions:
    function load:1.13-pre5 

    as you can see, this is instant

    function load:18w15a

    This takes ~20 seconds.

  3. If you run the second function again, it is instant until you do /reload