diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java index df0c86a..4fa173a 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/ConfigManager.java @@ -91,6 +91,7 @@ public class ConfigManager { // TODO ajouter les valeurs par défaut dans config.yml // TODO gérer les codes de coloration; + ServerMessages_defaultColor = ChatColor.YELLOW.toString(); ServerMessages_prefix = ChatColor.YELLOW+"["+ChatColor.WHITE+"Pandacraft"+ChatColor.YELLOW+"] "; //configFile.getString("server_messages_prefix"); @@ -144,7 +145,6 @@ public class ConfigManager { private void initAutomessages() { Automessages_messages = new ArrayList>(); - String default_color = ChatColor.YELLOW.toString(); Map message; @@ -154,7 +154,7 @@ public class ConfigManager { Automessages_messages.add(message); message = new HashMap(); - message.put("message", "WorldEdit disponible en &bCréatif"+default_color+" avec le grade &f[&eUltimate&f]"+default_color+". Profitez en vite :D%n&f &a http://mc-pandacraft.net/?p=ultimate"); + message.put("message", "WorldEdit disponible en &bCréatif"+ServerMessages_defaultColor+" avec le grade &f[&eUltimate&f]"+ServerMessages_defaultColor+". Profitez en vite :D%n &a http://mc-pandacraft.net/?p=ultimate"); message.put("permissions", "*"); Automessages_messages.add(message); @@ -339,7 +339,7 @@ public class ConfigManager { public List CuboCommand_worlds = new ArrayList(); public String ServerMessages_prefix; - + public String ServerMessages_defaultColor; diff --git a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AutoMessagesManager.java b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AutoMessagesManager.java index 7cfeb6c..93d44b7 100644 --- a/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AutoMessagesManager.java +++ b/src/net/mc_pandacraft/java/plugin/pandacraftutils/modules/AutoMessagesManager.java @@ -11,6 +11,7 @@ import net.mc_pandacraft.java.plugin.pandacraftutils.PandacraftUtils; import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayer; import net.mc_pandacraft.java.plugin.pandacraftutils.players.OnlinePlayerManager; +import org.bukkit.ChatColor; import org.bukkit.entity.Player; import org.bukkit.scheduler.BukkitRunnable; @@ -81,7 +82,7 @@ public class AutoMessagesManager extends BukkitRunnable { ArrayList ret = new ArrayList(); for (Map message : ConfigManager.getInstance().Automessages_messages) - ret.add(new AutoMessage(message.get("message"), message.get("permissions"))); + ret.add(new AutoMessage(ChatColor.translateAlternateColorCodes('&', message.get("message").replace("%n", "\n")), message.get("permissions"))); return ret; }