mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 22:16:22 +00:00
Fully async EssentialsMigrator
This commit is contained in:
1 parent
74fd90c37f
commit
58eeab20c5
2 files changed
+3
-5
No files matched your search
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>me.William278</groupId>
|
||||
<artifactId>HuskHomes</artifactId>
|
||||
<version>2.7.1</version>
|
||||
<version>2.7.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>HuskHomes</name>
|
||||
|
||||
@@ -33,6 +33,7 @@ public class EssentialsMigrator {
|
||||
|
||||
// Migrate data from EssentialsX
|
||||
public static void migrate(final String worldFilter, final String targetServer) {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
final File essentialsDataFolder = new File(Bukkit.getWorldContainer() + File.separator + "plugins" + File.separator + "Essentials");
|
||||
|
||||
if (essentialsDataFolder.exists()) {
|
||||
@@ -56,7 +57,6 @@ public class EssentialsMigrator {
|
||||
final String playerName = playerFileConfig.getString("last-account-name", playerFileConfig.getString("lastAccountName"));
|
||||
try {
|
||||
Connection connection = HuskHomes.getConnection();
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
try {
|
||||
if (!DataManager.playerExists(playerUUID, connection)) {
|
||||
DataManager.createPlayer(playerUUID, playerName, connection);
|
||||
@@ -106,7 +106,6 @@ public class EssentialsMigrator {
|
||||
} catch (SQLException e) {
|
||||
plugin.getLogger().log(Level.SEVERE, "An SQL exception occurred migrating Essentials home data.", e);
|
||||
}
|
||||
});
|
||||
|
||||
} catch (NullPointerException ignored) { }
|
||||
} catch (IllegalArgumentException ignored) { }
|
||||
@@ -121,7 +120,6 @@ public class EssentialsMigrator {
|
||||
|
||||
if (warpFiles != null) {
|
||||
Connection connection = HuskHomes.getConnection();
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||
for (File warpFile : warpFiles) {
|
||||
try {
|
||||
final FileConfiguration warpFileConfig = loadConfiguration(warpFile);
|
||||
@@ -163,7 +161,6 @@ public class EssentialsMigrator {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,5 +209,6 @@ public class EssentialsMigrator {
|
||||
plugin.getLogger().warning("Failed to Migrate from Essentials!");
|
||||
Bukkit.getLogger().warning("Could not find Essentials plugin data to migrate!");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user