Config don't reload

Discussion in 'Plugin Development' started by MaTaMoR_, Apr 1, 2015.

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

    MaTaMoR_

    Hi, i'm trying to reload my config but it does not work xD

    Code:
    public void reloadConfig() {
        if(scoreboardFile == null) {
            scoreboardFile = new File(plugin.getDataFolder(), "scoreboard.yml");
        }
       
        scoreboardConfig = YamlConfiguration.loadConfiguration(scoreboardFile);
       
        if(!scoreboardFile.exists()) {  
           
            InputStream defConfigStream = plugin.getResource("scoreboard.yml");
           
            if(defConfigStream != null) {
               
                plugin.saveResource("scoreboard.yml", false);
               
            }
        }
    }  
    
     
  2. Offline

    mine-care

    @MaTaMoR_
    Any errors?
    What it does?
    What the file looks like?

    Also you may want to use already existing methods from FileConfiguration class :p
     
  3. Offline

    MaTaMoR_

    1) No errors
    2)
    Code:
    Scoreboard:
        Title: '&7<player>'
        Body:
            - ''
            - '&5&lQuarks'
            - '&d<quarks>'
            - ''
            - '&6&lPartidas'
            - '&e<games>'
            - ''
            - '&3&lVictorias'
            - '&b<wins>'
            - ''
            - '&4&lPaginaWeb'
            - '&cquarkcraft.net'
            - '&8---------------'
    
    3) What do you mean ?
     
  4. Offline

    mythbusterma

    @MaTaMoR_

    What is the intent of this method?
     
  5. Offline

    MaTaMoR_

    Reload the config, and if the config don't exists create a new one .
     
Thread Status:
Not open for further replies.

Share This Page