From cfbd10cfb2644a981b9b2763166aa66fce5cd491 Mon Sep 17 00:00:00 2001 From: Alkalus Date: Tue, 7 Apr 2020 15:12:31 +0100 Subject: + 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. --- src/Java/gtPlusPlus/core/util/reflect/ReflectionUtils.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Java/gtPlusPlus/core/util/reflect') 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."); -- cgit