If we have converted data, save everything after JailIO is loaded.

This might solve #26 but I'm not closing it yet as this is untested.
This commit is contained in:
graywolf336
2014-05-03 01:12:26 -05:00
parent 42d0e7983f
commit ef5dfe3815
3 changed files with 34 additions and 2 deletions

View File

@ -51,8 +51,8 @@ public class JailMain extends JavaPlugin {
//Try to load the old stuff before we load anything, esp the storage stuff
LegacyManager lm = new LegacyManager(this);
if(lm.doWeNeedToConvert()) {
boolean converted = lm.convertOldData();
if(!converted) getLogger().severe("We was unable to convert some, or all, of the old data.");
lm.convertOldData();
if(!lm.wasAnythingConverted()) getLogger().severe("We was unable to convert some, or all, of the old data.");
}
io = new JailIO(this);
@ -67,6 +67,11 @@ public class JailMain extends JavaPlugin {
io.loadJails();
//If we converted something, let's save EVERYTHING including the cells
if(lm.wasAnythingConverted()) {
io.saveEverything();
}
cmdHand = new CommandHandler(this);
jh = new JailHandler(this);
pm = new PrisonerManager(this);