diff --git a/src/main/java/org/sgrewritten/stargate/Stargate.java b/src/main/java/org/sgrewritten/stargate/Stargate.java index dddf04d9..18d1f1c4 100644 --- a/src/main/java/org/sgrewritten/stargate/Stargate.java +++ b/src/main/java/org/sgrewritten/stargate/Stargate.java @@ -330,7 +330,12 @@ private void registerListeners() { */ private boolean migrateConfigurationAndData() throws IOException, InvalidConfigurationException, SQLException, StargateInitializationException, URISyntaxException { DataMigrator dataMigrator = new DataMigrator(new File(this.getDataFolder(), StargateConstant.CONFIG_FILE), this.getDataFolder(), this.getStoredPropertiesAPI()); - + if (dataMigrator.getConfigVersion() <= 6) { + try (InputStream inputStream = Stargate.class.getResourceAsStream("/messages/migrationInit.txt")) { + String initMessage = FileHelper.readStreamToString(inputStream); + getLogger().severe(initMessage); + } + } if (dataMigrator.isMigrationNecessary()) { File debugDirectory = new File(this.getDataFolder(), "debug"); if (!debugDirectory.isDirectory() && !debugDirectory.mkdir()) { diff --git a/src/main/java/org/sgrewritten/stargate/migration/DataMigrator.java b/src/main/java/org/sgrewritten/stargate/migration/DataMigrator.java index 113d75f7..831847d8 100644 --- a/src/main/java/org/sgrewritten/stargate/migration/DataMigrator.java +++ b/src/main/java/org/sgrewritten/stargate/migration/DataMigrator.java @@ -132,4 +132,8 @@ private boolean isMigrationNecessary(DataMigration dataMigration) { return dataMigration.getConfigVersion() > configVersion; } + public int getConfigVersion(){ + return configVersion; + } + } \ No newline at end of file diff --git a/src/main/resources/messages/migrationInit.txt b/src/main/resources/messages/migrationInit.txt new file mode 100644 index 00000000..c55bef5e --- /dev/null +++ b/src/main/resources/messages/migrationInit.txt @@ -0,0 +1,5 @@ +You are upgrading from a legacy version to a rewritten version. + +This involves upgrading your server's Stargate data to a new format. + +Your old data has been moved to plugins\stargate\debug\legacy. \ No newline at end of file