Rename config entries class
continuous-integration/drone/push Build is passing

This commit is contained in:
bea
2023-02-11 20:57:29 +01:00
parent 7f792b5ca8
commit 122b4b064c
10 changed files with 47 additions and 47 deletions
@@ -1,7 +1,7 @@
package wtf.beatrice.hubthat.utils.files;
import wtf.beatrice.hubthat.HubThat;
import wtf.beatrice.hubthat.utils.ConfigEntries;
import wtf.beatrice.hubthat.utils.ConfigEntry;
import wtf.beatrice.hubthat.utils.LocalizedMessage;
import org.bukkit.configuration.file.YamlConfiguration;
@@ -37,21 +37,21 @@ public class OldConfigConversion
FileUtils.checkFiles();
// newPath, oldPath
HashMap<ConfigEntries, String>newAndOldConfigEntries = new HashMap<>();
HashMap<ConfigEntry, String>newAndOldConfigEntries = new HashMap<>();
logger.warning("Loading config entries...");
newAndOldConfigEntries.put(ConfigEntries.HUB_DELAY, "hub.delay");
newAndOldConfigEntries.put(ConfigEntries.SPAWN_DELAY, "spawn.delay");
newAndOldConfigEntries.put(ConfigEntries.WORLD_RELATED_CHAT, "global.world-related-chat");
newAndOldConfigEntries.put(ConfigEntries.UPDATE_CHECKER_ENABLED, "updates.update-notify");
newAndOldConfigEntries.put(ConfigEntries.MOVEMENT_DETECTION_ENABLED, "global.move-detect");
newAndOldConfigEntries.put(ConfigEntries.GAMEMODE_SET_ON_JOIN, "global.set-gamemode-on-join");
newAndOldConfigEntries.put(ConfigEntries.GAMEMODE, "global.gamemode");
newAndOldConfigEntries.put(ConfigEntries.TELEPORTATION_TP_HUB_ON_JOIN, "global.tp-hub-on-join");
newAndOldConfigEntries.put(ConfigEntries.TELEPORTATION_TP_HUB_ON_RESPAWN, "global.tp-hub-on-respawn");
newAndOldConfigEntries.put(ConfigEntries.TELEPORTATION_RESPAWN_HANDLER, "global.respawn-handler");
newAndOldConfigEntries.put(ConfigEntry.HUB_DELAY, "hub.delay");
newAndOldConfigEntries.put(ConfigEntry.SPAWN_DELAY, "spawn.delay");
newAndOldConfigEntries.put(ConfigEntry.WORLD_RELATED_CHAT, "global.world-related-chat");
newAndOldConfigEntries.put(ConfigEntry.UPDATE_CHECKER_ENABLED, "updates.update-notify");
newAndOldConfigEntries.put(ConfigEntry.MOVEMENT_DETECTION_ENABLED, "global.move-detect");
newAndOldConfigEntries.put(ConfigEntry.GAMEMODE_SET_ON_JOIN, "global.set-gamemode-on-join");
newAndOldConfigEntries.put(ConfigEntry.GAMEMODE, "global.gamemode");
newAndOldConfigEntries.put(ConfigEntry.TELEPORTATION_TP_HUB_ON_JOIN, "global.tp-hub-on-join");
newAndOldConfigEntries.put(ConfigEntry.TELEPORTATION_TP_HUB_ON_RESPAWN, "global.tp-hub-on-respawn");
newAndOldConfigEntries.put(ConfigEntry.TELEPORTATION_RESPAWN_HANDLER, "global.respawn-handler");
logger.warning("Converting config entries...");
for(ConfigEntries entry : newAndOldConfigEntries.keySet())
for(ConfigEntry entry : newAndOldConfigEntries.keySet())
{
logger.warning("Entry: " + entry.path);
FileUtils.FileType.CONFIG_YAML.yaml.set(entry.path, oldConfig.get(newAndOldConfigEntries.get(entry)));