mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 06:28:49 +00:00
Much renaming and some movement
This commit is contained in:
69 files changed
+621
-606
No files matched your search
+10
-10
@@ -1,11 +1,11 @@
|
||||
package me.william278.huskhomes2.migrators;
|
||||
|
||||
import me.william278.huskhomes2.HuskHomes;
|
||||
import me.william278.huskhomes2.objects.Home;
|
||||
import me.william278.huskhomes2.objects.TeleportationPoint;
|
||||
import me.william278.huskhomes2.objects.Warp;
|
||||
import me.william278.huskhomes2.dataManager;
|
||||
import me.william278.huskhomes2.settingHandler;
|
||||
import me.william278.huskhomes2.teleport.Home;
|
||||
import me.william278.huskhomes2.teleport.TeleportationPoint;
|
||||
import me.william278.huskhomes2.teleport.Warp;
|
||||
import me.william278.huskhomes2.data.DataManager;
|
||||
import me.william278.huskhomes2.SettingHandler;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
@@ -16,7 +16,7 @@ import java.util.UUID;
|
||||
|
||||
import static org.bukkit.configuration.file.YamlConfiguration.loadConfiguration;
|
||||
|
||||
public class essentialsMigrator {
|
||||
public class EssentialsMigrator {
|
||||
|
||||
// Migrate data from EssentialsX
|
||||
public static void migrate() {
|
||||
@@ -40,7 +40,7 @@ public class essentialsMigrator {
|
||||
Bukkit.getLogger().info("Migrating user data for " + playerName);
|
||||
try {
|
||||
Set<String> essentialsHomes = playerFileConfig.getConfigurationSection("homes").getKeys(false);
|
||||
dataManager.createPlayer(uuid, playerName);
|
||||
DataManager.createPlayer(uuid, playerName);
|
||||
for (String home : essentialsHomes) {
|
||||
|
||||
// Get
|
||||
@@ -54,7 +54,7 @@ public class essentialsMigrator {
|
||||
Home playerHome = new Home(new TeleportationPoint(worldName, x, y, z, yaw, pitch, serverID), playerName, uuidS, home, playerName + "'s home", false);
|
||||
|
||||
Bukkit.getLogger().info("> Migrated home " + home);
|
||||
dataManager.addHome(playerHome, uuid);
|
||||
DataManager.addHome(playerHome, uuid);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
Bukkit.getLogger().info("No home data found for " + playerName);
|
||||
@@ -81,7 +81,7 @@ public class essentialsMigrator {
|
||||
float pitch = (float) warpFileConfig.getDouble("pitch");
|
||||
|
||||
Warp warp = new Warp(new TeleportationPoint(worldName, x, y, z, yaw, pitch, serverID), warpName, "A publicly accessible warp");
|
||||
dataManager.addWarp(warp);
|
||||
DataManager.addWarp(warp);
|
||||
|
||||
Bukkit.getLogger().info("Migrated warp \"" + warpName + "\"");
|
||||
} catch (NullPointerException e) {
|
||||
@@ -106,7 +106,7 @@ public class essentialsMigrator {
|
||||
float pitch = (float) spawnConfig.getDouble("spawns.all.pitch");
|
||||
|
||||
Location spawnLocation = new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
|
||||
settingHandler.setSpawnLocation(spawnLocation);
|
||||
SettingHandler.setSpawnLocation(spawnLocation);
|
||||
Bukkit.getLogger().info("/spawn position has been migrated!");
|
||||
} catch (Exception e) {
|
||||
Bukkit.getLogger().warning("Error obtaining /spawn position!");
|
||||
+10
-10
@@ -1,10 +1,10 @@
|
||||
package me.william278.huskhomes2.migrators;
|
||||
|
||||
import me.william278.huskhomes2.HuskHomes;
|
||||
import me.william278.huskhomes2.objects.Home;
|
||||
import me.william278.huskhomes2.objects.TeleportationPoint;
|
||||
import me.william278.huskhomes2.configManager;
|
||||
import me.william278.huskhomes2.dataManager;
|
||||
import me.william278.huskhomes2.teleport.Home;
|
||||
import me.william278.huskhomes2.teleport.TeleportationPoint;
|
||||
import me.william278.huskhomes2.config.ConfigManager;
|
||||
import me.william278.huskhomes2.data.DataManager;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.util.UUID;
|
||||
import static org.bukkit.configuration.file.YamlConfiguration.loadConfiguration;
|
||||
|
||||
// This class migrates data from HuskHomes 1.5.x to HuskHomes 2.x
|
||||
public class legacyVersionMigrator {
|
||||
public class LegacyMigrator {
|
||||
|
||||
public static boolean startupMigrate;
|
||||
private static String sourcePlayerTable;
|
||||
@@ -114,7 +114,7 @@ public class legacyVersionMigrator {
|
||||
|
||||
// Reload settings with new ones
|
||||
plugin.reloadConfig();
|
||||
configManager.loadConfig();
|
||||
ConfigManager.loadConfig();
|
||||
} catch (Exception e) {
|
||||
Bukkit.getLogger().warning("Failed to migrate data; " + e.getCause() + " when trying to migrate config data");
|
||||
startupMigrate = false;
|
||||
@@ -149,9 +149,9 @@ public class legacyVersionMigrator {
|
||||
UUID uuid = UUID.fromString(resultSet.getString("UUID"));
|
||||
String username = resultSet.getString("USERNAME");
|
||||
int homeSlots = resultSet.getInt("HOME_SLOTS");
|
||||
if (!dataManager.playerExists(uuid)) {
|
||||
if (!DataManager.playerExists(uuid)) {
|
||||
Bukkit.getLogger().info("> Migrating player data for \"" + username + "\"");
|
||||
dataManager.createPlayer(uuid, username, homeSlots);
|
||||
DataManager.createPlayer(uuid, username, homeSlots);
|
||||
}
|
||||
}
|
||||
connection.close();
|
||||
@@ -189,10 +189,10 @@ public class legacyVersionMigrator {
|
||||
TeleportationPoint teleportationPoint = new TeleportationPoint(worldName, x, y, z, yaw, pitch, server);
|
||||
|
||||
// Add the home to the database
|
||||
if (!dataManager.homeExists(ownerUsername, name)) {
|
||||
if (!DataManager.homeExists(ownerUsername, name)) {
|
||||
Bukkit.getLogger().info("> Migrating home \"" + ownerUsername + "." + name + "\"");
|
||||
Home home = new Home(teleportationPoint, ownerUsername, ownerUUID, name, description, isPublic);
|
||||
dataManager.addHome(home, UUID.fromString(ownerUUID));
|
||||
DataManager.addHome(home, UUID.fromString(ownerUUID));
|
||||
}
|
||||
}
|
||||
connection.close();
|
||||
Reference in new issue
Block a user