MinecraftTAS / LoTAS

Low Optimization Tool Assisted Speedrun Mod 1.8.9-1.20.1
https://minecrafttas.com
GNU General Public License v3.0
51 stars 10 forks source link

Savestates (3.0) 📁 #76

Closed ScribbleTAS closed 2 years ago

ScribbleTAS commented 2 years ago

Goal

Savestate loading that doesn't close the Minecraft server, but instead change the region files underneath and reload the chunks once it's done copying

Implementation

In 1.12.2 you could easily achieve this by making the player think they switch dimensions, when in fact it switches dimensions to the same world they are currently in. So the steps would be:

  1. Remove the player from the chunk map
  2. Unload the minecraft world
  3. Copy files
  4. Pre-Load the minecraft world
  5. Add the player to the chunk map

This all worked fine but in 1.14+ new obstacles appeared.

Observations

  1. The world has to fully close for it to leave the references to the reagion files
  2. The player can't be easily removed from the chunk map to simulate a dimension change
  3. Loading the player in the new dimension is done via a respawn packet
  4. Loading the world again is pretty slow