Solved Config/Color Issues

Discussion in 'Plugin Development' started by iiHeroo, Sep 17, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    iiHeroo

    So, here's the issue, when I edit the config.yml lines, it's fine, and the response is what you edit it to, but, when I add a color code to the line, it returns with what the original response was(default), but when you look in the config.yml, the color code is still there, here's my config.yml and my code, there's not much code yet, since recoding it.

    config: http://pastie.org/8334591

    code:
    Code:java
    1. package org.horrgs.me;
    2.  
    3. import java.util.logging.Logger;
    4.  
    5. import org.bukkit.ChatColor;
    6. import org.bukkit.command.Command;
    7. import org.bukkit.command.CommandSender;
    8. import org.bukkit.configuration.file.FileConfiguration;
    9. import org.bukkit.entity.Player;
    10. import org.bukkit.plugin.java.JavaPlugin;
    11.  
    12. public class serverinfoplus extends JavaPlugin {
    13.  
    14. public final Logger logger = Logger.getLogger("Minecraft");
    15. private FileConfiguration config;
    16. public static serverinfoplus plugin;
    17.  
    18. @Override
    19. public void onEnable(){
    20. config = getConfig();
    21. saveDefaultConfig();
    22. }
    23.  
    24. @Override
    25. public void onDisable(){
    26.  
    27. }
    28.  
    29.  
    30.  
    31. public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    32. Player player = (Player) sender;
    33. if(commandLabel.equalsIgnoreCase("sip"))
    34. if(args.length == 1) {
    35. if(args[0].equalsIgnoreCase("1"))
    36. player.sendMessage(ChatColor.DARK_BLUE + "[" + ChatColor.BLUE + "SIP" + ChatColor.DARK_BLUE + "] " + ChatColor.GOLD + "Version 1.5 by " + ChatColor.DARK_AQUA + "iiHeroo" + ChatColor.AQUA + " " + ChatColor.GOLD + "Type /sip (1/2/3) for command information. " + ChatColor.GOLD + "/sip" + ChatColor.GRAY + " - " + ChatColor.BLUE + "The ServerInfoPlus help command. " + ChatColor.GOLD + "/open" + ChatColor.GRAY + " - " + ChatColor.BLUE + "Tell's you the date the server opened.");
    37. }
    38. if(commandLabel.equalsIgnoreCase("facebook"))
    39. player.sendMessage(ChatColor.translateAlternateColorCodes('&', getConfig().getString("pfacebook")) + ChatColor.translateAlternateColorCodes('&', getConfig().getString("facebook")));
    40.  
    41.  
    42.  
    43.  
    44.  
    45. return false;
    46.  
    47. }
    48. }
     
  2. Offline

    Gater12

    I would put a ' like:
    Facebook: '&7facebook.com/facebook'
     
  3. Offline

    iiHeroo


    Yeah, I know, I saw you comment on my other thread that, and I think, "Silly me, I forgot the ' ' !"
     
    Gater12 likes this.
Thread Status:
Not open for further replies.

Share This Page