9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-28 02:59:13 +00:00

Allow conversion of v1-v3 data snapshots

This commit is contained in:
William
2023-09-22 21:27:11 +01:00
parent 7034a97d3a
commit 856cbb9caa
2 changed files with 3 additions and 11 deletions

View File

@@ -41,6 +41,7 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.OffsetDateTime;
import java.util.*;
import java.util.logging.Level;
public class BukkitLegacyConverter extends LegacyConverter {
@@ -55,10 +56,7 @@ public class BukkitLegacyConverter extends LegacyConverter {
final JSONObject object = new JSONObject(plugin.getDataAdapter().bytesToString(data));
final int version = object.getInt("format_version");
if (version != 3) {
throw new DataAdapter.AdaptionException(String.format(
"Unsupported legacy data format version: %s. Please downgrade to an earlier version of HuskSync, " +
"perform a manual legacy migration, then attempt to upgrade again.", version
));
plugin.log(Level.WARNING, String.format("Converting data from older v2 data format (%s).", version));
}
// Read legacy data from the JSON object