diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2017-07-10 00:22:21 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2017-07-10 00:22:21 +1000 |
commit | 99ebf8e09d19c949af4986fa20459c8f87c455ea (patch) | |
tree | fa76c2ff4d0acc8ec4f0dbbcdbd11c053d842c13 /src/Java/gtPlusPlus/core/util | |
parent | 28a80cb3dc2392a8adb501a6f5d67319e4ce8e10 (diff) | |
download | GT5-Unofficial-99ebf8e09d19c949af4986fa20459c8f87c455ea.tar.gz GT5-Unofficial-99ebf8e09d19c949af4986fa20459c8f87c455ea.tar.bz2 GT5-Unofficial-99ebf8e09d19c949af4986fa20459c8f87c455ea.zip |
$ Fixed .09 features trying to work in .08.
+ Moved lots of things to reflection again.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java | 14 | ||||
-rw-r--r-- | src/Java/gtPlusPlus/core/util/math/MathUtils.java | 11 |
2 files changed, 11 insertions, 14 deletions
diff --git a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java index 0c98751398..8ba355d57f 100644 --- a/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java +++ b/src/Java/gtPlusPlus/core/util/gregtech/recipehandlers/GregtechRecipe.java @@ -71,16 +71,4 @@ class LibProxy2 extends LibraryProxy { throw new RuntimeException(e); } } -} - -/*class Lib { // v1 - public static void addRecipe(ItemStack aInput, ItemStack aOutput) { - System.out.println("shit totally happened v1"); - } -} - -class Lib2 { // v2 - public static void addRecipe(ItemStack aInput, ItemStack aOutput, boolean hidden) { - System.out.println("shit totally happened v2"); - } -}*/
\ No newline at end of file +}
\ No newline at end of file diff --git a/src/Java/gtPlusPlus/core/util/math/MathUtils.java b/src/Java/gtPlusPlus/core/util/math/MathUtils.java index 7ed15ec27b..a46bd8c61d 100644 --- a/src/Java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/Java/gtPlusPlus/core/util/math/MathUtils.java @@ -3,6 +3,7 @@ package gtPlusPlus.core.util.math; import java.util.Map; import java.util.Random; +import gregtech.api.enums.GT_Values; import gtPlusPlus.core.util.Utils; import gtPlusPlus.xmod.gregtech.api.objects.XSTR; @@ -96,7 +97,7 @@ public class MathUtils { } while (((bits-val)+(n-1)) < 0L); return val; } - + /** * Returns a psuedo-random number between min and max, inclusive. * The difference between min and max can be at most @@ -359,4 +360,12 @@ public class MathUtils { } } + public static int safeInt(long number, int margin){ + return number>Integer.MAX_VALUE-margin ? Integer.MAX_VALUE-margin :(int)number; + } + + public static int safeInt(long number){ + return number>GT_Values.V[GT_Values.V.length-1] ? safeInt(GT_Values.V[GT_Values.V.length-1],1) : number<Integer.MIN_VALUE ? Integer.MIN_VALUE : (int)number; + } + } |