diff options
author | Alkalus <Draknyte1@hotmail.com> | 2020-04-07 15:12:31 +0100 |
---|---|---|
committer | Alkalus <Draknyte1@hotmail.com> | 2020-04-07 15:12:31 +0100 |
commit | cfbd10cfb2644a981b9b2763166aa66fce5cd491 (patch) | |
tree | acd969969f05ca2883203eef6409cc217102c4bc /src/Java/gtPlusPlus/core/util/reflect | |
parent | acf7193504fba4a7165d2ba5732cc9ce5f35ec55 (diff) | |
download | GT5-Unofficial-cfbd10cfb2644a981b9b2763166aa66fce5cd491.tar.gz GT5-Unofficial-cfbd10cfb2644a981b9b2763166aa66fce5cd491.tar.bz2 GT5-Unofficial-cfbd10cfb2644a981b9b2763166aa66fce5cd491.zip |
+ Added support for Custom Machines being registered to the PA. (If GT is up-to date)
+ Added more ASM patches for better Hazmat handling.
% Renamed Chemical Dehydrator to Dehydrator for clearer logic in NEI.
$ Fixed a small bug in ReflectionUtils.
$ Rewrote parts of my Hazmat handling, it should now work correctly for all items which apply radiation from IC2/GT or their addons.
Diffstat (limited to 'src/Java/gtPlusPlus/core/util/reflect')
-rw-r--r-- | src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 59d20835ae..8b9b5cf94f 100644 --- a/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -537,17 +537,17 @@ public class ReflectionUtils { public static Object invokeNonBool(Object objectInstance, Method method, Object[] values){ - if (objectInstance == null || method == null || values == null){ + if ((!ReflectionUtils.isStaticMethod(method) && objectInstance == null) || method == null || values == null){ return false; } String methodName = method.getName(); - Class<?> mLocalClass = (objectInstance instanceof Class ? (Class<?>) objectInstance : objectInstance.getClass()); - Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+mLocalClass.getCanonicalName()+"."); + String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName(); + Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+"."); try { return method.invoke(objectInstance, values); } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+mLocalClass.getName()); + Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname); } Logger.REFLECTION("Invoke failed or did something wrong."); |