Uploaded image for project: 'Bukkit'
  1. Bukkit
  2. BUKKIT-2390

unloadWorld should completely unload region files

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Bukkit API
    • Security Level: Public (Viewable by everyone)

      Description

      EDIT: This appears to be a bug, as there probably aren't any reasons to leave files open after closing a world, and I change the suggestion to not have a boolean, but to just close the region files when unloading a world.

      Old post:
      The unload world command in org.bukkit.Server.unloadWorld should have a boolean such as "fullunload" which would allow the world to be completely unloaded from the server as if the server had been shut down (ie no more objects in memory referencing the world's region files, etc)

      This would allow plugins to modify the entire world folder and region files quickly without worrying about concurrent modification.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            biel Biel Simon Rojas added a comment -

            So, we have to do that manually?

            Show
            biel Biel Simon Rojas added a comment - So, we have to do that manually?
            Hide
            skaterzero807 Brendan added a comment -

            Yes, I've added the code from cybertiger's git pull request which goes through the region files and closes them to my own plugin. Then you also have to add craftbukkit as a reference to your project, just make sure your project still references bukkit, and bukkit first.

            Then, if/when this is fixed, you should be able to remove the code from your plugin and the craftbukkit reference, if you don't use NMS calls anywhere else

            Show
            skaterzero807 Brendan added a comment - Yes, I've added the code from cybertiger's git pull request which goes through the region files and closes them to my own plugin. Then you also have to add craftbukkit as a reference to your project, just make sure your project still references bukkit, and bukkit first. Then, if/when this is fixed, you should be able to remove the code from your plugin and the craftbukkit reference, if you don't use NMS calls anywhere else
            Hide
            wolvereness Wesley Wolfe added a comment -

            Unloading a world when saving to disk correctly purges open file handles. Minecraft is not designed to release a file of which it had read and expects to write to. From the called methods, it's safe to assume references to said world (therefor file handles) may still be accessible, therefor, closing files is still an invalid course of action.

            Show
            wolvereness Wesley Wolfe added a comment - Unloading a world when saving to disk correctly purges open file handles. Minecraft is not designed to release a file of which it had read and expects to write to. From the called methods, it's safe to assume references to said world (therefor file handles) may still be accessible, therefor, closing files is still an invalid course of action.
            Hide
            biel Biel Simon Rojas added a comment -

            It HAVE to be fixed! That you said is for the vanilla minecraft server, but the bukkit servers maybe want to reset a world without closing the server (a world loaded with Bukkit.createWorld()). Why you don't want fix it?? An other user have created the code to fix it!

            Show
            biel Biel Simon Rojas added a comment - It HAVE to be fixed! That you said is for the vanilla minecraft server, but the bukkit servers maybe want to reset a world without closing the server (a world loaded with Bukkit.createWorld()). Why you don't want fix it?? An other user have created the code to fix it!
            Hide
            cuzgeorge George added a comment -

            +1 like- upvoting this plugin, i know its older and we on 1.7.9 now, but who knows? might help.

            Show
            cuzgeorge George added a comment - +1 like- upvoting this plugin, i know its older and we on 1.7.9 now, but who knows? might help.

              People

              • Votes:
                21 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: