Fixed default message copying

This commit is contained in:
games647
2016-06-15 17:35:10 +02:00
parent 6d1a97fd32
commit 2881689f09
3 changed files with 11 additions and 4 deletions

View File

@ -49,11 +49,18 @@ public class BukkitCore extends FastLoginCore {
InputStreamReader defaultReader = new InputStreamReader(plugin.getResource("messages.yml"), Charsets.UTF_8);
YamlConfiguration defaults = YamlConfiguration.loadConfiguration(defaultReader);
messageConfig.setDefaults(defaults);
for (String key : defaults.getKeys(false)) {
String message = ChatColor.translateAlternateColorCodes('&', defaults.getString(key));
if (!message.isEmpty()) {
localeMessages.put(key, message);
}
}
for (String key : messageConfig.getKeys(false)) {
String message = ChatColor.translateAlternateColorCodes('&', messageConfig.getString(key));
if (!message.isEmpty()) {
if (message.isEmpty()) {
localeMessages.remove(key);
} else {
localeMessages.put(key, message);
}
}

View File

@ -44,7 +44,7 @@ public class PremiumCommand implements CommandExecutor {
} else {
UUID id = ((Player) sender).getUniqueId();
if (plugin.getConfig().getBoolean("premium-warning") && !plugin.getPendingConfirms().contains(id)) {
sender.sendMessage(plugin.getCore().getMessage("premium-warming"));
sender.sendMessage(plugin.getCore().getMessage("premium-warning"));
plugin.getPendingConfirms().add(id);
return true;
}

View File

@ -84,7 +84,7 @@ invalid-requst: '&4Invalid request'
not-started: '&cServer is not fully started yet. Please retry'
# Warning message if a user invoked /premium command
premium-warming: '&6WARNING: This command should only be invoked if you are the owner of this paid minecraft account
premium-warning: '&6WARNING: This command should only be invoked if you are the owner of this paid minecraft account
Type /premium again to confirm'
# ========= Bungee/Waterfall only ================================