World Rollback error

Discussion in 'BungeeCord Plugin Development' started by DeadSilenceIV, Jul 5, 2018.

  1. Hi guys, I'm trying to roll back a world, when i'm starting the server the rollback is done without problems, but in game shows the following problem:
    [?:1.8.0_121]
    [15:44:14] [Server thread/ERROR]: Couldn't save chunk; already in use by another instance of Minecraft?
    net.minecraft.server.v1_8_R3.ExceptionWorldConflict: The save for world located at .\Globo is being accessed from another location, aborting
    at net.minecraft.server.v1_8_R3.WorldNBTStorage.checkSession(WorldNBTStorage.java:72) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.World.checkSession(World.java:2824) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.ChunkRegionLoader.a(ChunkRegionLoader.java:120) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.ChunkProviderServer.saveChunk(ChunkProviderServer.java:251) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.ChunkProviderServer.unloadChunks(ChunkProviderServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.WorldServer.doTick(WorldServer.java:234) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:770) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at java.lang.Thread.run(Unknown Source)

    This is the method that I use to make the rollback:
    Code (Java):
    public void prepareArenaWorld(Arena arena){
            Main.getInstance().getServer().unloadWorld(arena.getName(), false);
            File dir = new File(arena.getName());
            File dir2 = new File(Main.getInstance().getDataFolder() + File.separator + "arenas" + File.separator + arena.getName());
            if (dir2.exists()) {
                if (!dir.exists()) {
                    dir.mkdirs();
                }
                try {
                    FileUtils.copyDirectory(dir2, dir);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }