WorldReset
WorldReset v2.0
Presenting the world's first standalone map reset plugin! When you restart your server, if resetting is enabled in the plugin's config.yml, WorldReset automatically deletes your world folders and imports backups of them stored in '.../plugins/WorldReset/backups'. WR can reset multiple worlds or regenerate them with random seeds, perfect for minigames and mining worlds.
NOTE: In order for this plugin to work, you have to /stop then start the server. A simple /reload will not work, and will likely cause the server to crash.
Setup/Usage
A world reset couldn't be more simple! Just follow these steps:
- Copy the world folder you want to revert to when you reset the map
- Find the 'WorldReset' folder in your server's 'plugins' directory. If the folder doesn't exist, run the server once and it will be created.
- Paste the world folder you copied into the 'backups' folder in the WorldReset directory.
- Repeat steps 1-3 for your Nether and End folders if you want to reset them as well.
- List the names of any worlds you want to delete and regenerate with random seeds under the "random-seed.worlds" config node
- If you want to schedule a restart, either run the server and type /wr reset or open the config.yml (found in the WorldReset directory) and set the "reset-worlds-on-next-restart" node to true.
- Start up your server! Your world folder will be reset to the one in '.../plugins/WorldReset/backups'!
Benefits
- Resets player location and inventories to their state stored in the world backup (you can always delete player data in the backup for standard spawning)
- Much less lag than conventional reset methods - instead of rolling back an area block by block, WorldReset simply imports the entire world folder, meaning that resets take less than a second!
- Because WorldReset doesn't have to deal with individual chunks, there's no danger of chunk corruption as long as your backup world is clean
- Random seed world regeneration is perfect for mining worlds that require diamonds and other valuables to be relocated every time the map resets
Commands
Configuration nodes
Configuration nodes
- reset-worlds-on-next-restart: true/false - whether to reset worlds (or regenerate them with new seeds, if enabled) the next time the server starts up
- random-seed.enabled: true/false - whether to delete and regenerate the worlds listed below with random seeds
- random-seed.worlds: - a list of the names of worlds to be regenerated
- reset-server-when-empty: true/false - whether to reset the server after the below player count has been achieved and all players log off
- player-count-to-activate-reset: 10 - the number of players online at the same time that must be achieved in order to schedule a reset to occur when the last player logs off (this setting only matters if the above node is set to 'true')
- always-reset: true/false - whether to reset/regenerate worlds every time the server starts up
Permissions nodes
- worldreset.reload: permission to run '/wr reload' to reload the configuration
- worldreset.reset: permission to schedule or cancel a world reset, including '/wr reset now'
- worldreset.settings.view: permission to view the configuration settings ingame with '/wr settings'
- worldreset.settings.edit: permission to edit the configuration settings ingame with '/wr settings edit \<setting ID> \<setting value>'
Can you add a random seed generating a world? If I have this world to griefing and mining, players know, where diamond, iron etc. are..
@LinearLogic
Thanks for the information, i will do some tests :D
@roundriderdev
I'm adding autoreset toggleability in the next update.
@LihPeu
A number of super perms managers have the ability to add expiration dates to permissions. I was able to reset the world folder during the onLoad() portion of the plugin's initialization because the chunks had not been loaded (and the system file lock had not been applied) at that point in the server's startup process. You'll have to experiment to confirm this, but I imagine plugin folders will be harder to edit, as they have been locked by the time they reach the onLoad() point.
How can I edit my startup so when my server stops, it automatically starts back up? I'm on a Mac.
It works but when it reset the worlds the "reset-worlds-on-next-restart" node gets to false. I want it to reset the world EVERY time I restart the server. Is there any alternative or something? Thanks!
Hey,
We host a mini game thats now much faster to reset thanks to your great plugin. Do you know of a way to reset/delete a permission folder? I use bpermissions and currently that's the only part of the game reset which I have to manually. I'm going to studie other permission plugins today, see if I can find one that has a delete world permissions command/option. Else I will be writing a plugin that might be similar to yours that targets a the bpermissions world folder. Do you think a plugin could do this?
@DJTomek
Next update will include the ability to choose whether you want an automatic reset or a command-activated one. Further down the line I'm hoping to include a proper scheduler.
Can you add a pernament reseting world? I reset my server every 24 hours and i would reset this map too. But if I set in config true, after reset it set to false again and i have to type a command.
It would be nice if you can add this.
@comniemeer
Thanks for the support. Feel free to let me know if there's anything you'd like to see implemented in the future (although it'll be a while before I have a chance to actually add features, as I have several major projects lined up).
@VergilPrime
If you're importing one of the standard worlds (world, world_nether, world_the_end), there should be no issue with importing one of the worlds by itself. My one caveat would be that three standard server worlds are "compatible" with each other, so it'd make sense to reset a version of world_the_end that was originally paired with the world and world_nether you're currently running.
As for custom worlds, they will reset/import just fine. I assume, however, that you're using a world management plugin (such as Multiverse), as by default servers don't support custom worlds (i.e. allow for easy movement between the worlds, etc.).
GREAT PLUGIN!!!
If I wanted just my End World and maybe a few customs like Disposal to be reset, could I do that? and can I disable the player inventory wiping as well?
@TheMinekings
Just uploaded WorldReset v1.2! Multiple worlds are now supported, and the plugin is no longer absurdly anal about world names. It features lots of checkers to make sure nothing gets deleted or imported unless you want it to.
New config node: "reset-worlds-on-next-restart". If set to true, the world will reset on, well, next restart. If not, the reset (including deletion and import) will be aborted.
New command: "/resetworld". If typed once, it sets the aforementioned node to 'true'. If typed again, the plugin stops the server and kicks all online players with the message "Resetting world(s)!"
If there's anything you'd like to see added or implemented differently, feel free to let me know.
@Reptar_
Not sure, as I host servers (using TCAdmin) and I've never much looked into other hosts. Just shoot their support team a call; I'd be surprised if they can't find you a solution.
BeastNode?
@Reptar_
Most gameserver hosting software (TCAdmin, MCMyAdmin, etc.) includes the option for an automatic restart, and there are plenty of scripts you can employ if you're using an SSH setup.
Ok, so I'd have to manually start my server up? Darn. I'm guessing there's no way of manually booting a server up when it goes down. . .
@Reptar_
Sadly no.
Due to the way Craftbukkit servers currently work, that is impossible. The world is only saved and unlocked for editing when the server comes to a full stop - there's simply no way around that and it isn't likely to change. If it does, however, you can be sure I'll update WorldReset to take advantage of the new system right away.
So you're making it to where the world can reset without stopping the server?
@LinearLogic
Cant wait until the update!