diff options
author | huajijam <strhuaji@gmail.com> | 2019-03-18 20:48:01 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-18 20:48:01 +0800 |
commit | 847934e3f0ba597f6d43d5fafdd0e6192d007585 (patch) | |
tree | c82b2784655f51b48c430d0cdd22e70b0523aa11 /src/Java/gtPlusPlus/xmod/witchery | |
parent | 40d7e5da9f5b84213e2c3e4596fdc69b94bd523e (diff) | |
parent | f93d9fb323a5aee2ed5c30320998f26bc177d707 (diff) | |
download | GT5-Unofficial-847934e3f0ba597f6d43d5fafdd0e6192d007585.tar.gz GT5-Unofficial-847934e3f0ba597f6d43d5fafdd0e6192d007585.tar.bz2 GT5-Unofficial-847934e3f0ba597f6d43d5fafdd0e6192d007585.zip |
just fix more bugs
just fix more bugs
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/witchery')
-rw-r--r-- | src/Java/gtPlusPlus/xmod/witchery/WitchUtils.java | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/Java/gtPlusPlus/xmod/witchery/WitchUtils.java b/src/Java/gtPlusPlus/xmod/witchery/WitchUtils.java index b28ccdaa9b..9e5efb452c 100644 --- a/src/Java/gtPlusPlus/xmod/witchery/WitchUtils.java +++ b/src/Java/gtPlusPlus/xmod/witchery/WitchUtils.java @@ -67,20 +67,17 @@ public class WitchUtils { } } - public static Field getField(String aClassName, String aFieldName) { - Class c; - try { - c = Class.forName(aClassName); - if (c != null) { - Field f = ReflectionUtils.getField(c, aFieldName); - if (f != null) { - return f; - } - } - } catch (ClassNotFoundException | NoSuchFieldException e) { + public static Field getField(String aClassName, String aFieldName) { + Class c; + c = ReflectionUtils.getClass(aClassName); + if (c != null) { + Field f = ReflectionUtils.getField(c, aFieldName); + if (f != null) { + return f; + } } return null; - } + } public static boolean isEqual(final GameProfile a, final GameProfile b) { return a != null && b != null && a.getId() != null && b.getId() != null && a.getId().equals(b.getId()); |