Bukkit thinks this is equal to 0.0

Discussion in 'Plugin Development' started by Gecco1234, May 10, 2014.

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

    Gecco1234

    Bukkit thinks tax is equal to 0.0 when Multipler is equal to 1
    Code:java
    1. double multipliercost = 4000 * fc.getInt("Multiplier");
    2. double tax = multipliercost * 1.5;
     
  2. Offline

    DxDy

    Your problem here is with Java, not with Bukkit ;) Have you made sure that Multiplier actually has a reasonable value (in this case 1) in your code and not just in your config-file?
    Apart from that I do not see what else could go wrong here.

    Btw: You propably want your multiplier to be a double to allow for a finer distinction than just 1 and 2 ;)
     
  3. Offline

    Gecco1234

    What do you mean reasonable value?
     
  4. Offline

    DxDy

    System.out.println(fc.getInt("Multiplier"))

    You should check whether the value from your configuration also arrives in the code ;)
     
  5. Offline

    Gecco1234

    Oh it comes out as a 0
    EDIT: Oh thanks it was a spelling mistake of multiplier!
     
Thread Status:
Not open for further replies.

Share This Page