Help with strings and configs

Discussion in 'Plugin Development' started by 1Achmed1, Aug 15, 2013.

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

    1Achmed1

    So, I have a concept for a new plugin, but I was wondering how I can get multiple strings from a config file. Like, say we were using SimpleAlias, how do I get lines that may or may not be there?so far I have this in the config:
    Code:
    blockedWords:
      -bleep
      -bleepity
    
    And here's what I have for java code:
    Code:
    .replace(getConfig().getString("blockedWords"), "*****");
    
    What comes before the .replace is just a chat listener. Anyways, not that I've tested this, I was just wondering about it.
     
  2. 1Achmed1 Uhrm, just do List<String> list = (List) config.get("blockedWords"); since it's just a List? Or maybe this works too : List<String> list = config.getList("blockedWords"); and then just use the chatlistener, loop trough the words, if the list contains one of the words then just replace it.
     
  3. Offline

    Rocoty

  4. Offline

    1Achmed1

    I look like an idiot.

    EDIT: I have experience developing bukkit plugins but none in java xD. Well, minus some things like vars and $htuff :p
     
Thread Status:
Not open for further replies.

Share This Page