package com.alttd.playerutils.config; import com.alttd.playerutils.util.Logger; import java.io.File; import java.util.List; public class Messages extends AbstractConfig { static Messages config; private final Logger logger; Messages(Logger logger) { super( new File(System.getProperty("user.home") + File.separator + "share" + File.separator + "configs" + File.separator + "PlayerUtils"), "messages.yml", logger); this.logger = logger; } public static void reload(Logger logger) { config = new Messages(logger); config.readConfig(Messages.class, null); } public static class HELP { private static final String prefix = "help."; public static String HELP_MESSAGE_WRAPPER = "PlayerUtils help:\n"; public static String HELP_MESSAGE = "Show this menu: /pu help"; public static String GLOW = "Glow in a specified color: /pu glow "; public static String XP_CHEQUE = "Create an XP cheque: /pu xpcheque "; public static String XP_CALC = "Calculate the amount of XP between levels: /pu xpcalc "; public static String RELOAD = "Reload the configs for PlayerUtils: /pu reload"; public static String ROTATE_BLOCK = "Enable rotating blocks with a blaze rod: /pu rotateblock"; @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); GLOW = config.getString(prefix, "glow", GLOW); XP_CHEQUE = config.getString(prefix, "xp-cheque", XP_CHEQUE); XP_CALC = config.getString(prefix, "xp-calc", XP_CALC); RELOAD = config.getString(prefix, "reload", RELOAD); ROTATE_BLOCK = config.getString(prefix, "rotate-block", ROTATE_BLOCK); } } 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 GLOW { private static final String prefix = "pu-command.glow"; public static String GLOW_OFF = "Glow turned off"; public static String GLOW_ON = "Glow turned on, you are now glowing "; public static String UNABLE_TO_GET_SCOREBOARD = "Unable to get scoreboard for team"; public static String GLOW_OFF_FOR_PLAYER = "Glow turned off for "; public static String GLOW_ON_FOR_PLAYER = "Glow turned on for they are now glowing "; @SuppressWarnings("unused") private static void load() { GLOW_OFF = config.getString(prefix, "glow-off",GLOW_OFF); GLOW_ON = config.getString(prefix, "glow-on",GLOW_ON); UNABLE_TO_GET_SCOREBOARD = config.getString(prefix, "unable-to-get-scoreboard",UNABLE_TO_GET_SCOREBOARD); } } public static class XP_CHEQUE { private static final String prefix = "pu-command.xp-cheque."; public static String FAILED_STORAGE = "Unable to create custom item for XP cheque"; public static String NEGATIVE = "You cannot enter a negative value for XP."; public static String NOT_ENOUGH_XP = "Not enough XP, you have "; public static String NOT_HOLDING_BOTTLE = "You need to hold an empty glass bottle while executing this command"; public static String DISPLAY_NAME = "XP bottle containing XP"; public static List LORE = List.of("Issued by ", "Throw to retrieve XP"); @SuppressWarnings("unused") private static void load() { FAILED_STORAGE = config.getString(prefix, "failed-storage", FAILED_STORAGE); NEGATIVE = config.getString(prefix, "negative", NEGATIVE); NOT_ENOUGH_XP = config.getString(prefix, "not-enough-xp", NOT_ENOUGH_XP); NOT_HOLDING_BOTTLE = config.getString(prefix, "not-holding-bottle", NOT_HOLDING_BOTTLE); DISPLAY_NAME = config.getString(prefix, "display-name", DISPLAY_NAME); LORE = config.getStringList(prefix, "lore", LORE); } } public static class XP_CALC { private static final String prefix = "pu-command.xp-cheque."; public static String XP_NEEDED = "Xp needed ."; @SuppressWarnings("unused") private static void load() { XP_NEEDED = config.getString(prefix, "xp-needed", XP_NEEDED); } } public static class RELOAD { private static final String prefix = "pu-command.reload."; public static String RELOADED = "Reloaded configs"; @SuppressWarnings("unused") private static void load() { RELOADED = config.getString(prefix, "reloaded", RELOADED); } } public static class ROTATE_BLOCK { private static final String prefix = "pu-command.rotate-block."; public static String ENABLED = "You enabled rotating blocks by left clicking them with a wooden hoe"; public static String DISABLED = "You disabled rotating blocks"; @SuppressWarnings("unused") private static void load() { ENABLED = config.getString(prefix, "enabled", ENABLED); DISABLED = config.getString(prefix, "disabled", DISABLED); } } }