Default system encoding have may misread config.yml...

Discussion in 'Plugin Development' started by deleted_91027365, May 17, 2015.

Thread Status:
Not open for further replies.
  1. Hey,

    I´m on a big project! But I have a problem :(

    Code:

    Code:
        @EventHandler
        public void join(PlayerJoinEvent e){
            Player p = e.getPlayer();
            if(p.isOp()) {
                e.setJoinMessage(ChatColor.translateAlternateColorCodes('&',getConfig().getString("Config.join-message-op").replace("%Player%", p.getDisplayName())));
            }else{
                e.setJoinMessage(ChatColor.translateAlternateColorCodes('&',getConfig().getString("Config.join-message").replace("%Player%", p.getDisplayName())));
            }
           
        }
    

    Config.yml

    Code:
    Config:
      join-message: '&a+ &f %Player%'
      join-message-op: '&a+ &4%Player%'
    
    So, after reloading it, the config looks like:
    Code:
    Config:
      join-message: "\xa7a+ %Player%"
      join-message-op: "\xa7a+ &4%Player%"
     
    What did I make wrong?
     
  2. Offline

    seanliam2000

    I am getting the same message in my console for mine
     
  3. Offline

    Zombie_Striker

    Does it still work? Does it still turn '&'s to &4Player
     
  4. Offline

    TheDiamond06

    @dunklesToast Using & symbols for color codes in config will not work. The reading of it will default back to the yml language of color codes. You need to translate color codes.
     
    Last edited: May 22, 2015
Thread Status:
Not open for further replies.

Share This Page