World Reset When No Players

Discussion in 'Archived: Plugin Requests' started by x128, Jul 27, 2013.

  1. Offline

    x128

    Plugin category: Admin

    Suggested name: EmptyReset

    What I want: I would like a simple plugin that when no players are in a world, it erases the world file and replaces it with a predefined world. This should work for multiple different worlds. Inside the "EmptyReset" folder, there is a config file as well as a "Worlds" folder. The worlds folder is where you place the untouched worlds to get copied when a world gets reset. The config should look something like this:

    ---------------------------------
    #Default configuration for EmptyReset
    #Format worlds to get reset when empty as shown below
    # world_folder_in_root_directory,world_folder_in_EmptyReset_worlds_folder

    derpworld1,cleanderp
    derpworld2,cleanderp
    derpworld3,cleanderp
    ---------------------------------

    Ideas for commands: No commands needed for this plugin.

    Ideas for permissions: No permissions are needed for this plugin

    When I'd like it by: As soon as possible :)

    If you need any more information, or don't even know what the hell I am talking about, please let me know :)
     
  2. Offline

    jdawgerj515

    What do you mean by "pre-defined world"?
     
  3. Offline

    x128

    For this example we will pretend the config states derpworld1,cleanderp
    As soon as all players leave the world derpworld1, the world derpworld1 will be deleted from the server, and cleanderp would be copied to the root server folder and also renamed derpworld1.
     
  4. Offline

    jdawgerj515

    x128 I would give it a go but I have never deleted worlds before in Bukkit. The rest of the plugin would be a piece of cake.
     
  5. Offline

    x128

    I have another plugin that deletes a player.dat file when the player disconnects. You might be able to use some of this code for this plugin. Here is the forum thread.
     
  6. Offline

    timtower Administrator Administrator Moderator

    Use the File class, comes with java itself
     
  7. Offline

    jdawgerj515

    x128 Wait doesn't that Plugin do almost the exact same thing as that one?

    EDIT: Oh wait sorry, I re-read. That one deletes players' dat file. However that did actually help. I will try making this. Do you want me to put it on dev.bukkit.org?

    x128
    Wait is derpworld1, derpworld2, ect. all actual worlds that you have already have. Or can it be made so that it just makes a new world randomly once there are no players online?

    Nvm I dont think you can delete worlds while server is Enabled.

    Maybe someone a little more experienced/advanced would take on this?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  8. Offline

    Williscool98

    A better idea would be to make a plugin that deletes map on shutdown, then look up a way to have the server automatically start up (there's a tool for this, I believe), then just regenerate that world on startup, all when no one is on.
     

Share This Page