9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2026-01-04 15:41:35 +00:00

Fixed redis password got reset after updating

This commit is contained in:
XiaoMoMi
2024-09-07 17:01:50 +08:00
parent 6dfb1dedf0
commit b6bfb96fab
4 changed files with 33 additions and 21 deletions

View File

@@ -19,6 +19,7 @@ package net.momirealms.customfishing.bukkit.storage;
import com.google.gson.JsonSyntaxException;
import dev.dejvokep.boostedyaml.YamlDocument;
import dev.dejvokep.boostedyaml.settings.updater.UpdaterSettings;
import net.momirealms.customfishing.api.BukkitCustomFishingPlugin;
import net.momirealms.customfishing.api.mechanic.config.ConfigManager;
import net.momirealms.customfishing.api.storage.DataStorageProvider;
@@ -78,12 +79,7 @@ public class BukkitStorageManager implements StorageManager, Listener {
@Override
public void reload() {
YamlDocument config = plugin.getConfigManager().loadConfig("database.yml");
try {
config.save(new File(plugin.getBoostrap().getDataFolder(), "database.yml"));
} catch (IOException e) {
throw new RuntimeException(e);
}
YamlDocument config = plugin.getConfigManager().loadConfig("database.yml", '.', UpdaterSettings.DEFAULT);
this.serverID = config.getString("unique-server-id", "default");
// Check if storage type has changed and reinitialize if necessary

View File

@@ -1,5 +1,3 @@
config-version: '${config_version}'
# file:
# JSON
# YAML