mirror of
https://github.com/Auxilor/EcoSkills.git
synced 2026-01-02 05:46:57 +00:00
Fixed automigrateor
This commit is contained in:
@@ -53,7 +53,10 @@ public class EcoSkillsPlugin extends EcoPlugin {
|
||||
effectsYml = new EffectsYml(this);
|
||||
dataHandler = this.getConfigYml().getBool("mysql.enabled")
|
||||
? new MySQLDataHandler(this) : new YamlDataHandler(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void handleEnable() {
|
||||
LegacyPlayerProfile.Companion.migrateAll();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.willfp.ecoskills.data.legacy
|
||||
|
||||
import com.willfp.eco.core.Eco
|
||||
import com.willfp.eco.core.data.PlayerProfile
|
||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||
import com.willfp.ecoskills.EcoSkillsPlugin
|
||||
@@ -54,12 +55,17 @@ class LegacyPlayerProfile private constructor(
|
||||
plugin.logger.info("so there's no need to worry about how long it takes. Once this is complete,")
|
||||
plugin.logger.info("feel free to delete data.yml as it won't be used anymore")
|
||||
plugin.logger.info("-----------------------------------------")
|
||||
Bukkit.getLogger().info(keys.toString())
|
||||
Bukkit.getLogger().info(mappedKeys.toString())
|
||||
for (offlinePlayer in Bukkit.getServer().offlinePlayers) {
|
||||
plugin.logger.info("Migrating player ${offlinePlayer.uniqueId}...")
|
||||
migrate(offlinePlayer)
|
||||
}
|
||||
plugin.logger.info("Migration complete!")
|
||||
plugin.logger.info("Saving...")
|
||||
plugin.configYml.set("mysql.migrated", true)
|
||||
plugin.configYml.save()
|
||||
Eco.getHandler().playerProfileHandler.saveAll(false)
|
||||
plugin.logger.info("Migration complete!")
|
||||
}
|
||||
|
||||
private fun migrate(player: OfflinePlayer) {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# This exists purely to be able to migrate player data
|
||||
# Go to /plugins/eco/config.yml to change MySQL settings
|
||||
mysql:
|
||||
migrated: false # Internal value - DO NOT CHANGE
|
||||
migrated: false # Internal value - DO NOT CHANGE, YOU RISK LOSING PLAYER DATA
|
||||
enabled: false # Set to false, data.yml will be used instead.
|
||||
host: localhost
|
||||
port: 3306
|
||||
|
||||
Reference in New Issue
Block a user