forked from TuxCoding/FastLogin
Fixed default message copying
This commit is contained in:
@ -49,11 +49,18 @@ public class BukkitCore extends FastLoginCore {
|
|||||||
|
|
||||||
InputStreamReader defaultReader = new InputStreamReader(plugin.getResource("messages.yml"), Charsets.UTF_8);
|
InputStreamReader defaultReader = new InputStreamReader(plugin.getResource("messages.yml"), Charsets.UTF_8);
|
||||||
YamlConfiguration defaults = YamlConfiguration.loadConfiguration(defaultReader);
|
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)) {
|
for (String key : messageConfig.getKeys(false)) {
|
||||||
String message = ChatColor.translateAlternateColorCodes('&', messageConfig.getString(key));
|
String message = ChatColor.translateAlternateColorCodes('&', messageConfig.getString(key));
|
||||||
if (!message.isEmpty()) {
|
if (message.isEmpty()) {
|
||||||
|
localeMessages.remove(key);
|
||||||
|
} else {
|
||||||
localeMessages.put(key, message);
|
localeMessages.put(key, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ public class PremiumCommand implements CommandExecutor {
|
|||||||
} else {
|
} else {
|
||||||
UUID id = ((Player) sender).getUniqueId();
|
UUID id = ((Player) sender).getUniqueId();
|
||||||
if (plugin.getConfig().getBoolean("premium-warning") && !plugin.getPendingConfirms().contains(id)) {
|
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);
|
plugin.getPendingConfirms().add(id);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ invalid-requst: '&4Invalid request'
|
|||||||
not-started: '&cServer is not fully started yet. Please retry'
|
not-started: '&cServer is not fully started yet. Please retry'
|
||||||
|
|
||||||
# Warning message if a user invoked /premium command
|
# 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'
|
Type /premium again to confirm'
|
||||||
|
|
||||||
# ========= Bungee/Waterfall only ================================
|
# ========= Bungee/Waterfall only ================================
|
||||||
|
Reference in New Issue
Block a user