Fix Config.java not loading and saving.

This commit is contained in:
Len 2024-06-17 10:12:26 +02:00
parent 2e2d370bc6
commit dacdacf68e

View File

@ -203,39 +203,39 @@ public class Config {
PLAYER_ONLY_COMMAND = getString("messages.command.player-only-command", PLAYER_ONLY_COMMAND);
NO_PLAYER_SPECIFIED = getString("messages.command.no-player-specified", NO_PLAYER_SPECIFIED);
PLAYER_NOT_FOUND = config.getString("messages.command.player-not-found", PLAYER_NOT_FOUND);
PLAYER_NOT_ONLINE = config.getString("messages.command.player-not-online", PLAYER_NOT_ONLINE);
COMMAND_NO_PERMISSION = config.getString("messages.command.no-permission", COMMAND_NO_PERMISSION);
PLAYER_INVENTORY_CLEARED = config.getString("messages.command.clear-inventory.player-inventory-cleared", PLAYER_INVENTORY_CLEARED);
INVENTORY_CLEARED_BY_OTHER = config.getString("messages.command.clear-inventory.inventory-clear-by-other", INVENTORY_CLEARED_BY_OTHER);
INVENTORY_CLEARED = config.getString("messages.command.clear-inventory.inventory-cleared", INVENTORY_CLEARED);
SPECIFY_HOME = config.getString("messages.command.home.specify-home", SPECIFY_HOME);
HOME_NOT_SET = config.getString("messages.command.home.home-not-set", HOME_NOT_SET);
HOME_DOES_NOT_EXIST = config.getString("messages.command.home.home-does-not-exist", HOME_DOES_NOT_EXIST);
HOME_TELEPORT = config.getString("messages.command.home.home-teleport", HOME_TELEPORT);
HOME_LIST = config.getString("messages.command.home.home-list", HOME_LIST);
HOME_SET = config.getString("messages.command.home.home-set", HOME_SET);
HOME_SET_MAX = config.getString("messages.command.home.home-set-max", HOME_SET_MAX);
INVALID_HOME_NAME = config.getString("messages.command.home.invalid-home-name", INVALID_HOME_NAME);
HOME_DELETED = config.getString("messages.command.home.invalid-home-name", HOME_DELETED);
PLAYER_NOT_FOUND = getString("messages.command.player-not-found", PLAYER_NOT_FOUND);
PLAYER_NOT_ONLINE = getString("messages.command.player-not-online", PLAYER_NOT_ONLINE);
COMMAND_NO_PERMISSION = getString("messages.command.no-permission", COMMAND_NO_PERMISSION);
PLAYER_INVENTORY_CLEARED = getString("messages.command.clear-inventory.player-inventory-cleared", PLAYER_INVENTORY_CLEARED);
INVENTORY_CLEARED_BY_OTHER = getString("messages.command.clear-inventory.inventory-clear-by-other", INVENTORY_CLEARED_BY_OTHER);
INVENTORY_CLEARED = getString("messages.command.clear-inventory.inventory-cleared", INVENTORY_CLEARED);
SPECIFY_HOME = getString("messages.command.home.specify-home", SPECIFY_HOME);
HOME_NOT_SET = getString("messages.command.home.home-not-set", HOME_NOT_SET);
HOME_DOES_NOT_EXIST = getString("messages.command.home.home-does-not-exist", HOME_DOES_NOT_EXIST);
HOME_TELEPORT = getString("messages.command.home.home-teleport", HOME_TELEPORT);
HOME_LIST = getString("messages.command.home.home-list", HOME_LIST);
HOME_SET = getString("messages.command.home.home-set", HOME_SET);
HOME_SET_MAX = getString("messages.command.home.home-set-max", HOME_SET_MAX);
INVALID_HOME_NAME = getString("messages.command.home.invalid-home-name", INVALID_HOME_NAME);
HOME_DELETED = getString("messages.command.home.invalid-home-name", HOME_DELETED);
TOGGLED_FLIGHT_BY_OTHER = config.getString("messages.command.fly.toggled-by-other", TOGGLED_FLIGHT_BY_OTHER);
TOGGLED_FLIGHT_PLAYER = config.getString("messages.command.fly.toggled-flight-other", TOGGLED_FLIGHT_PLAYER);
TOGGLED_FLIGHT = config.getString("messages.command.fly.toggled-flight", TOGGLED_FLIGHT);
NO_BACK_LOCATION = config.getString("messages.command.back.no-back-location", NO_BACK_LOCATION);
TELEPORTING_BACK = config.getString("messages.command.back.teleporting-back", TELEPORTING_BACK);
NO_DEATH_LOCATION = config.getString("messages.command.back.no-death-location", NO_DEATH_LOCATION);
TELEPORTING_BACK_DEATH = config.getString("messages.command.back.teleporting-back-death", TELEPORTING_BACK_DEATH);
BACK_DEATH_HINT = config.getString("messages.command.back.dback-hint", BACK_DEATH_HINT);
GAMEMODE_SET = config.getString("messages.command.gamemode.gamemode-set", GAMEMODE_SET);
GAMEMODE_SET_OTHER = config.getString("messages.command.gamemode.gamemode-set-other", GAMEMODE_SET_OTHER);
GAMEMODE_SET_BY_OTHER = config.getString("messages.command.gamemode.gamemode-set-by-other", GAMEMODE_SET_BY_OTHER);
HEAL_SELF = config.getString("messages.command.heal.heal-self", HEAL_SELF);
HEAL_OTHER = config.getString("messages.command.heal.heal-other", HEAL_OTHER);
HEAL_BY_OTHER = config.getString("messages.command.heal.heal-by-other", HEAL_BY_OTHER);
FEED_SELF = config.getString("messages.command.feed.feed-self", FEED_SELF);
FEED_OTHER = config.getString("messages.command.feed.feed-other", FEED_OTHER);
FEED_BY_OTHER = config.getString("messages.command.feed.feed-by-other", FEED_BY_OTHER);
TOGGLED_FLIGHT_BY_OTHER = getString("messages.command.fly.toggled-by-other", TOGGLED_FLIGHT_BY_OTHER);
TOGGLED_FLIGHT_PLAYER = getString("messages.command.fly.toggled-flight-other", TOGGLED_FLIGHT_PLAYER);
TOGGLED_FLIGHT = getString("messages.command.fly.toggled-flight", TOGGLED_FLIGHT);
NO_BACK_LOCATION = getString("messages.command.back.no-back-location", NO_BACK_LOCATION);
TELEPORTING_BACK = getString("messages.command.back.teleporting-back", TELEPORTING_BACK);
NO_DEATH_LOCATION = getString("messages.command.back.no-death-location", NO_DEATH_LOCATION);
TELEPORTING_BACK_DEATH = getString("messages.command.back.teleporting-back-death", TELEPORTING_BACK_DEATH);
BACK_DEATH_HINT = getString("messages.command.back.dback-hint", BACK_DEATH_HINT);
GAMEMODE_SET = getString("messages.command.gamemode.gamemode-set", GAMEMODE_SET);
GAMEMODE_SET_OTHER = getString("messages.command.gamemode.gamemode-set-other", GAMEMODE_SET_OTHER);
GAMEMODE_SET_BY_OTHER = getString("messages.command.gamemode.gamemode-set-by-other", GAMEMODE_SET_BY_OTHER);
HEAL_SELF = getString("messages.command.heal.heal-self", HEAL_SELF);
HEAL_OTHER = getString("messages.command.heal.heal-other", HEAL_OTHER);
HEAL_BY_OTHER = getString("messages.command.heal.heal-by-other", HEAL_BY_OTHER);
FEED_SELF = getString("messages.command.feed.feed-self", FEED_SELF);
FEED_OTHER = getString("messages.command.feed.feed-other", FEED_OTHER);
FEED_BY_OTHER = getString("messages.command.feed.feed-by-other", FEED_BY_OTHER);
}
public static String STORAGE_TYPE = "mysql";
@ -249,14 +249,14 @@ public class Config {
public static int MYSQL_CONNECTIONS = 10;
public static int MYSQL_QUEUE_DELAY = 5;
private static void storage() {
STORAGE_TYPE = config.getString("storage.type", STORAGE_TYPE);
AUTO_SAVE = config.getBoolean("storage.auto-save", AUTO_SAVE);
AUTO_SAVE_DELAY = config.getInt("storaeg.auto-save-delay", AUTO_SAVE_DELAY);
MYSQL_IP = config.getString("storage.mysql.ip", MYSQL_IP);
MYSQL_PORT = config.getString("storage.mysql.port", MYSQL_PORT);
MYSQL_DATABASE_NAME = config.getString("storage.mysql.database", MYSQL_DATABASE_NAME);
MYSQL_USERNAME = config.getString("storage.mysql.username", MYSQL_USERNAME);
MYSQL_PASSWORD = config.getString("storage.mysql.password", MYSQL_PASSWORD);
STORAGE_TYPE = getString("storage.type", STORAGE_TYPE);
AUTO_SAVE = getBoolean("storage.auto-save", AUTO_SAVE);
AUTO_SAVE_DELAY = getInt("storaeg.auto-save-delay", AUTO_SAVE_DELAY);
MYSQL_IP = getString("storage.mysql.ip", MYSQL_IP);
MYSQL_PORT = getString("storage.mysql.port", MYSQL_PORT);
MYSQL_DATABASE_NAME = getString("storage.mysql.database", MYSQL_DATABASE_NAME);
MYSQL_USERNAME = getString("storage.mysql.username", MYSQL_USERNAME);
MYSQL_PASSWORD = getString("storage.mysql.password", MYSQL_PASSWORD);
}
}