package com.alttd.hunger_games.config; import org.jetbrains.annotations.NotNull; import java.io.File; public class Messages extends AbstractConfig { static Messages config; Messages() { super( new File(File.separator + "mnt" + File.separator + "configs" + File.separator + "HungerGames"), "messages.yml"); } public static void reload() { config = new Messages(); config.readConfig(Messages.class, null); } public static class HELP { private static final String prefix = "help."; public static String HELP_MESSAGE_WRAPPER = "HungerGames help:\n"; public static String HELP_MESSAGE = "Show this menu: /hg help"; public static String ROUND_STATE = "Show the current round state: /hg roundstate"; public static String REGISTER = "Register a player for the game: /hg register "; @SuppressWarnings("unused") private static void load() { HELP_MESSAGE_WRAPPER = config.getString(prefix, "help-wrapper", HELP_MESSAGE_WRAPPER); HELP_MESSAGE = config.getString(prefix, "help", HELP_MESSAGE); ROUND_STATE = config.getString(prefix, "round-state", ROUND_STATE); REGISTER = config.getString(prefix, "register", REGISTER); } } public static class GENERIC { private static final String prefix = "generic."; public static String NO_PERMISSION = "'>You don't have permission for this command"; public static String PLAYER_ONLY = "This command can only be executed as a player"; public static String PLAYER_NOT_FOUND = "Unable to find online player "; @SuppressWarnings("unused") private static void load() { NO_PERMISSION = config.getString(prefix, "no-permission", NO_PERMISSION); PLAYER_ONLY = config.getString(prefix, "player-only", PLAYER_ONLY); PLAYER_NOT_FOUND = config.getString(prefix, "player-only", PLAYER_NOT_FOUND); } } public static class ROUND_STATE { private static final String prefix = "round-state."; public static String ROUND_STATE = "Current round state is: round_state"; @SuppressWarnings("unused") private static void load() { ROUND_STATE = config.getString(prefix, "round-state", ROUND_STATE); } } public static class REGISTER { private static final String prefix = "register."; public static String FAILED_TO_REGISTER_YOU = "You were unable to join HungerGames because no HungerGames round was found"; public static String FAILED_TO_REGISTER_PLAYER = "Unable to register player "; @SuppressWarnings("unused") private static void load() { FAILED_TO_REGISTER_YOU = config.getString(prefix, "failed", FAILED_TO_REGISTER_YOU); FAILED_TO_REGISTER_PLAYER = config.getString(prefix, "failed-player", FAILED_TO_REGISTER_PLAYER); } } }