Plugins automatically save their state when they unload and when the world saves.
I'd suggest removing the autosave on unloading a plugin. You can close a world without saving your changes, but your plugins state is forced to be saved? What if you had an issue where a plugin parsed some data incorrectly and you have a corrupted state?
Hooking into the world's save should be sufficient. You close the world and save changes, and your plugins save. You goof up and corrupt your state, you reinstall and it's fine. At the moment, reinstalling saves the bad state and reloads it, right?
I'd suggest removing the autosave on unloading a plugin. You can close a world without saving your changes, but your plugins state is forced to be saved? What if you had an issue where a plugin parsed some data incorrectly and you have a corrupted state?
Hooking into the world's save should be sufficient. You close the world and save changes, and your plugins save. You goof up and corrupt your state, you reinstall and it's fine. At the moment, reinstalling saves the bad state and reloads it, right?