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)
Reload the world
Run these two functions:
function load:1.13-pre5function load:1.13-pre5as you can see, this is instant
function load:18w15afunction load:18w15aThis takes ~20 seconds.
If you run the second function again, it is instant until you do
/reload
Attachments
Comments 8
@Neko no lighting issues aren’t the cause. As shown inthe videos I’m in a world completely filled with bedrock. Also, did you use the datapack’s structure and datapack’s function and not just a random one? Since I can always reproduce it with that datapack. (It’s also shown in the videos)
That’s sl strange. The other people two people that tested the pack before I added it to this ticket were also able to reproduce, and I also probably have run that function around 30 times, and was able to constantly reproduce. Wouldn’t the video be enough of a confirmation?
@unknown Could you try joining the world, then doing /reload and then executing the function? It seems to be having to do with the DataVersion tag in the structure file. I think it tries to update all the blocks (by scanning through the block list) if the DataVersion value is below a certain value. If it's done that, it loads the structure and remembers the updated version (probably in RAM) and when you load it again, it works. When doing /reload it probably clears the structure from RAM which is why it lags again if you run the function again after /reload
Are you running the function in the air? If so, the lag might be caused by lighting updates. Running the function on the ground loaded the structure instantly.