Modifying world async without loading

Discussion in 'Spigot Plugin Development' started by Jalau, Jun 6, 2016.

  1. So because I need to place many blocks in a short period of time I thought about whether it is possible to not load a world and be able to modify the world async by that way. Like editing the files right away. Or has anyone tried to start another mc server from the main server and this other mc server will load the world and place the blocks and after that the other server will be able to load it.
    Any help is appreciated.
     
  2. You could just unload the world, edit the region files and load it back on the server. This requires every player to disconnect from the world to modify though.
     
  3. How can I edit the region files? There are no players in the world at that time whatsoever.
     
  4. Write a custom plugin that reads the files straight from disk, knows the region format, and supports making changes and writing it back to disk. Or, use something like MCEdit to edit the world.
     
  5. Yea I could try that. But maybe someone got a util like this already. You never know.
     
  6. Take a look at the NMS classes RegionFileCache and RegionFile. The function RegionFileCache.a(File file, int i, int j) returns the RegionFile, it is thread-safe, file is the world folder and i and j are the chunk coordinates.
     
  7. I will, thanks!
     
    • Like Like x 1