Posted May 4, 201312 yr How can I make configoration file so I can change the value of a float? The float changes the color of something in game.
May 4, 201312 yr I dunno how the forge config works, but something like float red = (float)config.getDouble("red"); I think its my java of the variables.
May 5, 201312 yr Use config.get(category, key, defaultValue) with arguments String, string, double. Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
May 5, 201312 yr To add a float in a custom configuration file you need to do this: //Using f1 as the float name. float f1 = Float.parseFloat(config.get(Configuration.CATEGORY_GENERAL, "changetoanything", ""+3.14F).getValue()); //This basically adds 3.14 to the thing you enter.
May 5, 201312 yr To add a float in a custom configuration file you need to do this: //Using f1 as the float name. float f1 = Float.parseFloat(config.get(Configuration.CATEGORY_GENERAL, "changetoanything", ""+3.14F).getValue()); //This basically adds 3.14 to the thing you enter. That works as long as the value is a valid float, but I do not recommend it - it will crash with non-numeric input and is very prone to decimal point errors. Follow my mod(s) here: http://www.minecraftforum.net/topic/1969694-
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.