[Solved] - Returning a false boolean from config

Discussion in 'Plugin Development' started by herghost, Dec 4, 2011.

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

    herghost

    Hi all

    I have a problem where even in an option is set to false in my config file, the plugin is still reading it as true?

    I am getting the boolean like so:

    Code:
    boolean t = Configuration.getBoolean("money.isenabled");
    
    if(t = true)
    {}
    
    if(t = false)
    {}
    
    Does the return of booleans not work like this?

    Cheers
    Dave
     
  2. Offline

    coldandtired

    == checks for equality, not =. For booleans it's not even necessary:
    Code:
    if (t)
    {
    //something
    }
    else
    {
    //something else
    }
    
     
  3. Offline

    herghost

    ahh,

    many thanks :)
     
Thread Status:
Not open for further replies.

Share This Page