BungeeCord Config Problem

Discussion in 'BungeeCord Plugin Development' started by dandwhit, May 23, 2015.

  1. Hello!
    I'm making an update to my bungee command spy plugin which will allow it to survive reloads using a config file but I'm having a small issue.
    What I want to do is set p.getName() + ".commandspy" to false IF that string path doesn't exist or is set to true already.
    In Bukkit I can do something like this:
    PHP:
    if(!this.getConfig().contains(p.getName())) {
         this.getConfig().set(p.getName(), p.getName());
         this.saveConfig();
         return;
    }
    The above example is taken from a nickname plugin.
    In Bungee there is no "contains" thing so I can't do if(!config.contains(p.getName() + ".commandspy")) {

    Is there a way around this?
    How can I do the equivalent of:
    PHP:
    if(!config.contains(p.getName() + ".commandspy")) {
          config.set(p.getName() + ".commandspy", false;
          saveConfig();
          return;
    }
     
    #1 dandwhit, May 23, 2015
    Last edited: May 23, 2015
  2. if(!config.contains(p.getName()+".commandspy")){
    config.set(p.getName()+".commandspy",false;
    saveConfig();
    return;
    }
     
  3. No, that's the thing that I cannot do :p
    Because config.contains() isn't in bungeecord.
    This is bungeecord not bukkit/spigot.