aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/math
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-10-10 16:35:28 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-10-10 16:35:28 +1000
commit26e10439a576e08bc3261a6d7c6c00c6cad7b761 (patch)
treeb1b056901ce11d0339caf430ba1cb9ef686a53be /src/Java/gtPlusPlus/core/util/math
parent6d4f28c0b73afa2cdc59b9da24c290ec29bb9132 (diff)
downloadGT5-Unofficial-26e10439a576e08bc3261a6d7c6c00c6cad7b761.tar.gz
GT5-Unofficial-26e10439a576e08bc3261a6d7c6c00c6cad7b761.tar.bz2
GT5-Unofficial-26e10439a576e08bc3261a6d7c6c00c6cad7b761.zip
+ Added some Geothermal Generators.
+ Added recipes and fuels for all Geothermals. (Normal Lava and Pahoehoe Lava) $ Fixed workbench not saving crafting table contents when closed. % Changed internal loading of Workbenches, Tanks and Geothermals. % Disabled old workbench buttons, now using Gregtech Holo slots.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/math')
-rw-r--r--src/Java/gtPlusPlus/core/util/math/MathUtils.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
index 3df5693bc3..b4aec5a8bf 100644
--- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java
+++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java
@@ -103,6 +103,19 @@ public class MathUtils {
public static double decimalRoundingToWholes(double d) {
return 5*(Math.round(d/5));
}
+
+ public static int roundToClosestMultiple(double number, int multiple) {
+ int result = multiple;
+ if (number % multiple == 0) {
+ return (int) number;
+ }
+ // If not already multiple of given number
+ if (number % multiple != 0) {
+ int division = (int) ((number / multiple) + 1);
+ result = division * multiple;
+ }
+ return result;
+ }
/**