Solved Checking Arguments in the Config

Discussion in 'Plugin Development' started by s15c, Jul 5, 2013.

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

    s15c

    So, I'm making a shop plugin based off of configuration files. Basically, when a player tries to buy something, the arguments are the ID/Name (which will have to be defined in the config), and the amount. I've figured out how to make sure the amount argument (or args[1]) is an integer, but I don't know to make sure that the first argument exists in the config file. As it is, if I typed in /bbuy supercalifragilyougethepoint 64, how do I make sure supercalifragilyougetthepoint is actually a thing in the config?
     
  2. Offline

    Compressions

    s15c
    Code:
    if(getConfig().contains(path)) {
    //do something
    }
     
  3. Offline

    s15c

    Well don't I feel silly now. Thanks.
     
Thread Status:
Not open for further replies.

Share This Page