Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7361

World#setAutoSave(false) ignored on server stop

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • CraftBukkit version 3753-Spigot-7d7b241-b346a5f
    • only my test plugin
    • Yes

      I noticed when loading a custom world, if I use World#setAutoSave(false), this is ignored when the server is stopped.

      If I manually unload the world with Bukkit.unloadWorld(world, false), it works as expected.

      Code to load world and test:

       

      WorldCreator worldTest = new WorldCreator("world_test");
      World world = Bukkit.createWorld(worldTest);
      world.setAutoSave(false); 
      
      // Just to verify this actually set
      Bukkit.broadcastMessage("VerifyAutoSave: " + world.isAutoSave());

       

       

      While I understand I can manually unload the world, and prevent saving... this may prove difficult in the event the server crashes/stops and the world is saved.

       

      I'm including a test plugin. 

      Steps to reproduce, Test #1:

      • run command "/test load" (this will load the world using the code seen above)
      • run command "/test tp" (this will teleport you to the spawn of said new world)
      • go nuts, place some blocks, build a house, tower some wool...
      • run command "/stop" (you will notice in console "Saving chunks for level 'ServerLevel[world_test]'/minecraft:world_test")
      • start the server back up
      • run command "/test load" (we want to load that world again)
      • run command "/test tp" (you will be teleported to spawn of that world, and you will see your beautiful creation from earlier.... this is NOT what we want)

      Steps to reproduce, Test #1:

      • run command "/test load" (this will load the world using the code seen above)
      • run command "/test tp" (this will teleport you to the spawn of said new world)
      • place some NEW blocks (maybe a different color wool)
      • run command "/test unload" (this will unload the world using the Bukkit.unloadWorld(world, false) method)
      • run command "/test load"
      • run command "/test tp"
      • you will now be back at that world, and notice the blocks you just placed were not saved (as expected, yay)

            Unassigned Unassigned
            ShaneBee Shane Bee
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: