Solved getFloat

Discussion in 'Plugin Development' started by PatoTheBest, Jan 26, 2014.

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

    PatoTheBest

    AS you can see, there is no getConfig.getFloat method, so is this the most efficient method to do it?
    Code:java
    1. String pitch1 = SettingsManager.getInstance().getGameData().getString("arena.pitch"),
    2. yaw1 = SettingsManager.getInstance().getGameData().getString("arena.yaw");
    3. Float pitch = Float.parseFloat(pitch1),
    4. yaw = Float.parseFloat(yaw1);
     
  2. Offline

    felixfritz

    You could also get the double and cast it to a float.
     
  3. PatoTheBest
    What felixfritz said. Basically you'd do:

    Code:java
    1. (float) getConfig().getDouble(someValue)
     
  4. Offline

    PatoTheBest

    Ok, but both methods have the same efficiency?
     
  5. Offline

    PePsiGam3r

Thread Status:
Not open for further replies.

Share This Page