mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-23 18:45:31 +01:00
Fix the version file not saving
This commit is contained in:
parent
38279fade4
commit
11ffd64952
@ -181,10 +181,17 @@ public class ChestShop extends JavaPlugin {
|
||||
private final int CURRENT_DATABASE_VERSION = 1;
|
||||
|
||||
private void handleMigrations() {
|
||||
YamlConfiguration previousVersion = YamlConfiguration.loadConfiguration(loadFile("version"));
|
||||
File versionFile = loadFile("version");
|
||||
YamlConfiguration previousVersion = YamlConfiguration.loadConfiguration(versionFile);
|
||||
|
||||
if (previousVersion.get("version") == null) {
|
||||
previousVersion.set("version", CURRENT_DATABASE_VERSION);
|
||||
|
||||
try {
|
||||
previousVersion.save(versionFile);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
int lastVersion = previousVersion.getInt("version");
|
||||
|
Loading…
Reference in New Issue
Block a user