mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-08 11:41:28 +01:00
Force save on initial conversion.
This commit is contained in:
parent
14151f28c2
commit
fc0364a139
@ -167,15 +167,14 @@ public class UltimateKits extends SongodaPlugin {
|
||||
|
||||
displayItemHandler.start();
|
||||
particleHandler.start();
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, this::saveKits, 6000, 6000);
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> saveKits(false), 6000, 6000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPluginDisable() {
|
||||
saveKits();
|
||||
saveKits(false);
|
||||
dataFile.save();
|
||||
this.dataManager.bulkUpdateBlockData(this.getKitManager().getKitLocations());
|
||||
saveKits();
|
||||
kitManager.clearKits();
|
||||
HologramManager.removeAllHolograms();
|
||||
}
|
||||
@ -190,12 +189,11 @@ public class UltimateKits extends SongodaPlugin {
|
||||
this.setLocale(Settings.LANGUGE_MODE.getString(), true);
|
||||
|
||||
this.dataManager.bulkUpdateBlockData(this.getKitManager().getKitLocations());
|
||||
kitConfig.load();
|
||||
loadKits();
|
||||
}
|
||||
|
||||
void loadKits() {
|
||||
kitConfig.load();
|
||||
|
||||
Bukkit.getScheduler().runTaskLater(this, () -> {
|
||||
|
||||
//Empty kits from manager.
|
||||
@ -391,8 +389,8 @@ public class UltimateKits extends SongodaPlugin {
|
||||
/*
|
||||
* Saves registered kits to file.
|
||||
*/
|
||||
public void saveKits() {
|
||||
if (!loaded) return;
|
||||
public void saveKits(boolean force) {
|
||||
if (!loaded && !force) return;
|
||||
|
||||
// Hot fix for kit file resets.
|
||||
if (kitConfig.contains("Kits"))
|
||||
|
@ -48,7 +48,7 @@ public class Convert {
|
||||
}
|
||||
kitObj.setDelay(hook.getDelay(kit));
|
||||
}
|
||||
UltimateKits.getInstance().saveKits();
|
||||
UltimateKits.getInstance().saveKits(true);
|
||||
}
|
||||
|
||||
private static boolean isInJsonFormat() {
|
||||
|
@ -224,7 +224,7 @@ public class Kit {
|
||||
}
|
||||
}
|
||||
contents = list;
|
||||
plugin.saveKits();
|
||||
plugin.saveKits(false);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user