World still saving despite no auto save

Discussion in 'Spigot Plugin Development' started by The_Eonics, Jun 23, 2018.

  1. Hi there.

    So, I have this minigame plugin where players will be teleported from the main world to the game world, "map", when the game starts, and teleport them back when the game is over. The game allows free block placing and block breaking, so I'd like it to reset back to its original state every time the game ends.

    So, what I've done so far is:

    I've put these lines of code somewhere in onEnable() to load the world
    Code (Text):

    World w = Bukkit.getServer().createWorld(new WorldCreator("map"));
    And when the game ends, I do this to unload the world without saving, then reload the world for the next game to use:
    Code (Text):

    Bukkit.getServer().unloadWorld("map", false);
    Bukkit.getServer().createWorld(new WorldCreator("map"));
    I also unloaded the world in onDisable() (without creating of course), but the problem exists even without stopping the server. Blocks that were placed still remained, items dropped still remained. I've also made the console output world.isAutoSave() when the game starts and ends, which both returned false.

    What is strange is that it only seems to happen when the game is left running for a long time. For periods of a minute or less, the blocks do disappear and the map returns to its original state. However, when I made the game end at exactly 5 minutes, the blocks placed were still there, so it might have had something to do with the amount of time the world is left loaded. I've run out of ideas to fix it, does anyone here have any clue why this is happening, and how I could fix it?

    The only plugins I am running on my spigot server (which is 1.8.8) is the plugin I'm making, which never touched worlds and auto-saving before this, and ProtocolLib because I was lazy.
  2. Go to bukkit.yml > ticks-per > autosave. Change that number to 0,