PlayerUtils/src/main/java/com/alttd/playerutils/config/Messages.java

170 lines
8.3 KiB
Java

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(File.separator
+ "mnt" + 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 = "<gold>PlayerUtils help:\n<commands></gold>";
public static String HELP_MESSAGE = "<green>Show this menu: <gold>/pu help</gold></green>";
public static String GLOW = "<green>Glow in a specified color: <gold>/pu glow <color></gold></green>";
public static String XP_CHEQUE = "<green>Create an XP cheque: <gold>/pu xpcheque <xp_value> [amount]</gold></green>";
public static String XP_CALC = "<green>Calculate the amount of XP between levels: <gold>/pu xpcalc <from> <to></gold></green>";
public static String RELOAD = "<green>Reload the configs for PlayerUtils: <gold>/pu reload</gold></green>";
public static String ROTATE_BLOCK = "<green>Enable rotating blocks with a blaze rod: <gold>/pu rotateblock</gold></green>";
public static String KEY = "<green>Receive a key that you are owed: <gold>/pu key</gold></green>";
@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 = "<red><hover:show_text:'<red><permission></red>'>You don't have permission for this command</hover></red>";
public static String PLAYER_ONLY = "<red>This command can only be executed as a player</red>";
public static String PLAYER_NOT_FOUND = "<red>Unable to find online player <player></red>";
@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 = "<green>Glow turned off</green>";
public static String GLOW_ON = "<green>Glow turned on, you are now glowing <color></green>";
public static String UNABLE_TO_GET_SCOREBOARD = "<red>Unable to get scoreboard for team</red>";
public static String GLOW_OFF_FOR_PLAYER = "<green>Glow turned off for <player></green>";
public static String GLOW_ON_FOR_PLAYER = "<green>Glow turned on for <player> they are now glowing <color></green>";
@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 = "<red>Unable to create custom item for XP cheque</red>";
public static String NEGATIVE = "<red>You cannot enter a negative value for XP.</red>";
public static String NOT_ENOUGH_XP = "<red>Not enough XP, you have <xp></red>";
public static String NOT_HOLDING_BOTTLE = "<red>You need to hold an empty glass bottle while executing this command</red>";
public static String DISPLAY_NAME = "<yellow>XP bottle containing <xp> XP</yellow>";
public static List<String> LORE = List.of("Issued by <name>", "Throw to retrieve <xp> XP");
public static String NOT_ENOUGH_BOTTLE = "<red>You need to be holding <amount> glass bottles</red>";
public static String INVALID_AMOUNT = "<red>You can only create between 1 and 64 xp cheque's at a time</red>";
@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);
NOT_ENOUGH_BOTTLE = config.getString(prefix, "not-enough-bottle", NOT_ENOUGH_BOTTLE);
INVALID_AMOUNT = config.getString(prefix, "invalid-amount", INVALID_AMOUNT);
}
}
public static class XP_CALC {
private static final String prefix = "pu-command.xp-cheque.";
public static String XP_NEEDED = "<green>Xp needed <gold><xp_needed></gold>.</green>";
@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 = "<green>Reloaded configs</green>";
@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 = "<green>You enabled rotating blocks by left clicking them with a <gold>wooden hoe</gold></green>";
public static String DISABLED = "<green>You <red>disabled</red> rotating blocks</green>";
@SuppressWarnings("unused")
private static void load() {
ENABLED = config.getString(prefix, "enabled", ENABLED);
DISABLED = config.getString(prefix, "disabled", DISABLED);
}
}
public static class KEY {
private static final String prefix = "pu-command.key.";
public static String CRATE_NOT_EXIST = "<red>There is no crate called <crate></green>";
public static String RETRIEVED_ALL_KEYS = "<red>You already retrieved all <keys> keys for the <crate>.</red>";
public static String GAVE_KEY = "<green>You received a <crate> key. You have received <keys> out of <total_keys> keys. Make sure to use your key before requesting another</green>";
public static String GAVE_FINAL_KEY = "<green>You received your final <crate> key. You have received a total of <keys> keys for this crate.</green>";
@SuppressWarnings("unused")
private static void load() {
CRATE_NOT_EXIST = config.getString(prefix, "crate-not-exist", CRATE_NOT_EXIST);
RETRIEVED_ALL_KEYS = config.getString(prefix, "retrieved-all-keys", RETRIEVED_ALL_KEYS);
GAVE_KEY = config.getString(prefix, "gave-key", GAVE_KEY);
GAVE_FINAL_KEY = config.getString(prefix, "gave-final-key", GAVE_FINAL_KEY);
}
}
public static class BLOCK_BLOCK_USE {
private static final String prefix = "block-block-use.";
public static String BLOCKED = "<red>You are not powerful enough!</red>";
@SuppressWarnings("unused")
private static void load() {
BLOCKED = config.getString(prefix, "blocked", BLOCKED);
}
}
}