mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-09-29 15:07:40 +02: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 final int CURRENT_DATABASE_VERSION = 1;
|
||||||
|
|
||||||
private void handleMigrations() {
|
private void handleMigrations() {
|
||||||
YamlConfiguration previousVersion = YamlConfiguration.loadConfiguration(loadFile("version"));
|
File versionFile = loadFile("version");
|
||||||
|
YamlConfiguration previousVersion = YamlConfiguration.loadConfiguration(versionFile);
|
||||||
|
|
||||||
if (previousVersion.get("version") == null) {
|
if (previousVersion.get("version") == null) {
|
||||||
previousVersion.set("version", CURRENT_DATABASE_VERSION);
|
previousVersion.set("version", CURRENT_DATABASE_VERSION);
|
||||||
|
|
||||||
|
try {
|
||||||
|
previousVersion.save(versionFile);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int lastVersion = previousVersion.getInt("version");
|
int lastVersion = previousVersion.getInt("version");
|
||||||
|
Loading…
Reference in New Issue
Block a user