aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/util
diff options
context:
space:
mode:
authorAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-09 17:49:52 +0000
committerAlkalus <3060479+draknyte1@users.noreply.github.com>2022-01-09 17:49:52 +0000
commit13b79706b6eddef6118453bf51782ad01b3e8328 (patch)
tree28afa10d207b77e5e127c21ad71dbe8b698c8a84 /src/main/java/gtPlusPlus/core/util
parent77fb0cac1c9c2b57262f41da64926fe2778a3b65 (diff)
downloadGT5-Unofficial-13b79706b6eddef6118453bf51782ad01b3e8328.tar.gz
GT5-Unofficial-13b79706b6eddef6118453bf51782ad01b3e8328.tar.bz2
GT5-Unofficial-13b79706b6eddef6118453bf51782ad01b3e8328.zip
Partially implemented Computer Cube.
Fix Multis wanting Mufflers when pollution = 0. Fix getMethodName potentially crawling too far up the stack.
Diffstat (limited to 'src/main/java/gtPlusPlus/core/util')
-rw-r--r--src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 1ef925f793..aaec2024e4 100644
--- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -335,6 +335,9 @@ public class ReflectionUtils {
public static String getMethodName(final int depth) {
final StackTraceElement[] ste = new Throwable().getStackTrace();
//System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName());
+ if (ste.length < depth) {
+ return "No valid stack.";
+ }
return ste[depth+1].getMethodName();
}