aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/util/reflect
diff options
context:
space:
mode:
authorAlkalus <Draknyte1@hotmail.com>2020-04-14 00:05:16 +0100
committerAlkalus <Draknyte1@hotmail.com>2020-04-14 00:05:16 +0100
commit492aa5becc6c49cc3afde8c855b5bbcdc5055e51 (patch)
treef943b5bab32c4d89d71f7c19cee30fee5263be8c /src/Java/gtPlusPlus/core/util/reflect
parentd2eb439ba60e633ad0418af295ab237f04d4e4ee (diff)
downloadGT5-Unofficial-492aa5becc6c49cc3afde8c855b5bbcdc5055e51.tar.gz
GT5-Unofficial-492aa5becc6c49cc3afde8c855b5bbcdc5055e51.tar.bz2
GT5-Unofficial-492aa5becc6c49cc3afde8c855b5bbcdc5055e51.zip
+ Added an Advanced Hazmat Suit.
+ Added a T3 circuit for recipe selections. $ Disabled TT Thaumic Repairer patch. $ Fixed a bug in EnumUtils not correctly handling missing entries.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/reflect')
-rw-r--r--src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
index 8b9b5cf94f..e0634dfb14 100644
--- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
+++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java
@@ -508,6 +508,30 @@ public class ReflectionUtils {
Logger.REFLECTION("Invoke failed or did something wrong.");
return false;
}
+
+ public static boolean invokeVoid(Object objectInstance, Method method, Object[] values){
+ if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)){
+ //Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type: "+objectInstance.getClass().getName());
+ return false;
+ }
+ String methodName = method.getName();
+ String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName();
+ Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+".");
+ try {
+ Method mInvokingMethod = method;
+ if (mInvokingMethod != null){
+ Logger.REFLECTION(methodName+" was not null.");
+ mInvokingMethod.invoke(objectInstance, values);
+ Logger.REFLECTION("Successfully invoked "+methodName+".");
+ return true;
+ }
+ }
+ catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
+ Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname);
+ }
+ Logger.REFLECTION("Invoke failed or did something wrong.");
+ return false;
+ }
public static boolean invokeVoid(Object objectInstance, String methodName, Class[] parameters, Object[] values){
if (objectInstance == null || methodName == null || parameters == null || values == null){